forked from rdpeng/ProgrammingAssignment2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.R
More file actions
34 lines (25 loc) · 665 Bytes
/
test.R
File metadata and controls
34 lines (25 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## examples to test the code
## run provided code example ####
source("example.R")
rm(some.vector)
some.numbers <- c(1, 2, 3, 4, 5, 6, 7, 8)
summary(some.numbers)
some.vector <- makeVector(some.numbers)
str(some.vector)
cachemean(some.vector)
cachemean(some.vector)
## run own code ####
source(cachematrix.R)
# some random matrix
rm(testmatrix)
set.seed(42)
testmatrix <- matrix(c(rnorm(5),
rnorm(5),
rnorm(5),
rnorm(5),
rnorm(5)),
nrow = 5, ncol = 5)
testmatrix
some.matrix <- makeCacheMatrix(testmatrix)
cacheSolve(some.matrix)
## looks ok