Update figure_5_and_S3.R

Make compatible with clean formatting of Dryad submission.