rerp for the coursera course "r programming" assignment 2