Update cachematrix.R

This is the cacheMatrix.R for Programming Assignment 2.