R script for PML training assignment