From 981ab53c35c2445a68287f3af981856fc1b1ffda Mon Sep 17 00:00:00 2001 From: Saif-Arosh <75520259+Saif-Arosh@users.noreply.github.com> Date: Sat, 5 Dec 2020 14:11:23 +0600 Subject: [PATCH] Update cachematrix.R --- cachematrix.R | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cachematrix.R b/cachematrix.R index 462ed40c923..4b45237dacd 100644 --- a/cachematrix.R +++ b/cachematrix.R @@ -1,11 +1,9 @@ ## Pair of functions that cache the inverse of a matrix -## Usage: Pass the result of a makeCacheMatrix call to cacheSolve +#Usage: Pass the result of a makeCacheMatrix call to cacheSolve #' Util function that set the matrix and the inverse in an environment #' @param x an invertible matrix -#' examples -#' x = makeCacheMatrix(matrix(rnorm(9), 3, 3)) -#' x$set(matrix(rnorm(16), 4, 4)) + makeCacheMatrix <- function(x = matrix()) { # todo error if x is not a matrix inv <- NULL @@ -25,9 +23,7 @@ makeCacheMatrix <- function(x = matrix()) { #' Compute and cache the inverse of a matrix #' @param x the result of a previous makeCacheMatrix call #' @param ... additional arguments to pass to solve function -#' examples -#' x = makeCacheMatrix(matrix(rnorm(9), 3, 3)) -#' cacheSolve(x) + cacheSolve <- function(x, ...) { ## Return a matrix that is the inverse of 'x' inv <- x$getinverse()