R code and csv files