summaryrefslogtreecommitdiffhomepage
path: root/r.html.markdown
diff options
context:
space:
mode:
authorMarcel Ribeiro Dantas <ribeirodantasdm@gmail.com>2022-04-09 00:14:18 +0200
committerGitHub <noreply@github.com>2022-04-09 00:14:18 +0200
commitfbdc0115e9d53cf1b57f0bacd85094402b5af608 (patch)
treea49b202cee00b309c1209ecd1036d244c0a29618 /r.html.markdown
parent835d077573fea060406ca6e5096779526ae96760 (diff)
Update return of class(mat) according to R 4.0.0
A matrix is the special case of a two-dimensional ‘array’. Since R 4.0.0, ‘inherits(m, "array")’ is true for a ‘matrix’ ‘m’, which makes class(mat) return "matrix" "array", not only "matrix" as before.
Diffstat (limited to 'r.html.markdown')
-rw-r--r--r.html.markdown2
1 files changed, 1 insertions, 1 deletions
diff --git a/r.html.markdown b/r.html.markdown
index e90d5a97..c3422d2d 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -405,7 +405,7 @@ mat
# [2,] 2 5
# [3,] 3 6
# Unlike a vector, the class of a matrix is "matrix", no matter what's in it
-class(mat) # => "matrix"
+class(mat) # => "matrix" "array"
# Ask for the first row
mat[1,] # 1 4
# Perform operation on the first column