Create processing_functions.R

To make the code to generate the figures readable, code that perfoms repeated actions is held in this separate file. It should be placed in the same directory as the files which generate the figures.