completed R file for course assignment