R code for initial analysis

R code for initial analysis