R file for coursera