From 7d423b4dc4fe87a00278bb45f484688bfb6268d6 Mon Sep 17 00:00:00 2001 From: Revathi0612 Date: Mon, 7 Apr 2025 11:32:03 +0530 Subject: [PATCH] Create R Programming --- R Programming | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 R Programming diff --git a/R Programming b/R Programming new file mode 100644 index 00000000000..55476b60f62 --- /dev/null +++ b/R Programming @@ -0,0 +1,19 @@ +makeCacheMatrix <- function() { +mat <- NULL +inv_cache <- NULL +setMatrix <-function(x){ +mat <<-x +inv_cache<<- NULL +} +getInverse <- function() { +if (is.null(inv_cache)){ +inv_cache <<-solve(mat) +} +inv_cache +} +list(setMatrix=setMatrix,getInverse = getInverse) +} +cacheSolve <- function(x,...){ +inv_cache <-x$getInverse() +inv_cache +}