Initial R code