From fbdc0115e9d53cf1b57f0bacd85094402b5af608 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro Dantas Date: Sat, 9 Apr 2022 00:14:18 +0200 Subject: Update return of class(mat) according to R 4.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- r.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'r.html.markdown') 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 -- cgit v1.2.3