Skip to content

Commit 4818e4c

Browse files
Comments added to the R file
1 parent 7ea84dc commit 4818e4c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cachematrix.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Put comments here that give an overall description of what your
22
## functions do
33

4-
## Write a short comment describing this function
4+
## Function makeCacheMatrix creates a matrix
5+
## object that precalculates the inverse of a square matrix
56
makeCacheMatrix <- function(x = matrix()) {
67
m <- NULL
78
set <- function(y) {
@@ -16,7 +17,8 @@ makeCacheMatrix <- function(x = matrix()) {
1617
getsolve = getsolve)
1718
}
1819

19-
## Write a short comment describing this function
20+
## Calculates the inverse of a square matrix if not already
21+
## Cached
2022
cacheSolve <- function(x, ...) {
2123
m <- x$getsolve()
2224
if(!is.null(m)) {
@@ -27,4 +29,4 @@ cacheSolve <- function(x, ...) {
2729
m <- solve(data)
2830
x$setsolve(m)
2931
m
30-
}
32+
}

0 commit comments

Comments
 (0)