Add R code and .gitignore