Skip to content

Commit 8dff0e8

Browse files
committed
Typos
1 parent c419bb8 commit 8dff0e8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

cachematrix.R

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11

2-
## This file is the solution to programming assignment 2 and contains 2 functions.
2+
## This file is the solution to programming assignment 2 and contains two functions.
33

4-
## Make a list of functions that work on a captured varible to store a matrix and a cached version of the inverse of the same matrix.
5-
## No computation in this funxtion, only getter & setter functions that work on the captured variable.
4+
5+
## Make a list of functions that work on a captured varible.
6+
## Store a matrix and a cached version of the inverse of the same matrix.
7+
## No computation in this function, only getter & setter functions that work on the captured variable.
68

79
makeCacheMatrix <- function(x = matrix()) {
810

9-
## Store the cached inverse matrix "inside" this closure
11+
# Store the cached inverse matrix "inside" this closure (stored in the environment)
1012
cache <- NULL
1113

12-
## Getter / setter functions to return
14+
# Getter / setter functions to return
1315
get <- function() x
1416
getInverse <- function() cache
1517
setInverse <- function(m) cache <<- m
1618

17-
## return a list of functions, like the example code
19+
# Return a list of functions, like the example code
1820
list(get = get, getInverse = getInverse, setInverse = setInverse)
1921
}
2022

2123

22-
## Solve the inverse of a matrix, using the closue we created with makeCacheMatrix
23-
## If the cache is set return that. If not, solve() for matrix and return the result after setting the cache
24+
## Solve the inverse of a matrix, using the closure we created with makeCacheMatrix
25+
## If the cache is set return that.
26+
## If not, solve() for matrix and return the result after setting the cache
2427

2528
cacheSolve <- function(x, ...) {
2629

27-
inv <- x$getInverse() # # the varibale we will return after setting it to the correct matrix
30+
inv <- x$getInverse() # the varibale we will return after setting it to the correct matrix
2831

2932
if(is.null(inv)){
3033
# Nothing cached, solve and fill the cache

0 commit comments

Comments
 (0)