Revert "Revert "Update cachematrix.R""

This reverts commit 2e41b6183c809def61a936abe3360d3653474568.