R-Script for the course project