R Script for Week6 Assignment