R script and related files for course project