Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b796636

Browse files
committed
fixed a couple typos
1 parent b4a62e0 commit b796636

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cachematrix.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# matrix
88
makeCacheMatrix <- function(x=matrix()) {
99

10-
cached_solved_matrix <- NULL
11-
original_matrix <- matrix
10+
cached_solved_matrix <<- NULL
11+
original_matrix <<- matrix
1212

1313
## To me it makes the most sense to create and cache the solved matrix here.
1414
## When set, if the given matrix isn't equal to the existing matrix
@@ -18,7 +18,7 @@ makeCacheMatrix <- function(x=matrix()) {
1818
# sanity check
1919
matrix = as.matrix(matrix)
2020

21-
if (!identical(matrix,original_matrix) || is.null(cached_solved_matrix)) {
21+
if (!identical(matrix, original_matrix) || is.null(cached_solved_matrix)) {
2222
set_solved_matrix(cacheSolve(matrix))
2323
original_matrix <<- matrix
2424
}

0 commit comments

Comments
 (0)