Function for R_Prog Programming Assignment 2

Contains two new functions as part of the assignment for R_Prog
coursera.