R code for the analysis of peak data, research from Imperial College London