R script to calculate rough means