R HW assignment

added 2 functions for R programming HW assignment to cachematric.R