Adding R code from @fhr.

This is the code that Fran uses to analyse the extracted data.