Final version of run analyis R script