1
2
3
4
5
6
7
8
9
10
11
12
|
set.seed(123)
scores_mt = matrix(round(rnorm(40, mean = 80, sd=10)),
nrow = 10, ncol = 4,
dimnames = list(paste0("Stu",1:10),
paste0("Subject-",LETTERS[1:4])))
class(scores_mt)
# [1] "matrix" "array"
head(scores_mt)
# Subject-A Subject-B Subject-C Subject-D
# Stu1 74 92 69 84
# Stu2 78 84 78 77
# Stu3 96 84 70 89
|