initial R code