added analysis R script