Functiion for Data Science R Programming, Programming Assignment2