Update cachematrix.R

R Programming Project 2 answer