summaryrefslogtreecommitdiffhomepage
path: root/r.html.markdown
diff options
context:
space:
mode:
authorMarcel Ribeiro Dantas <ribeirodantasdm@gmail.com>2022-06-27 00:24:44 +0200
committerGitHub <noreply@github.com>2022-06-27 00:24:44 +0200
commit6162ab53ee855f3ddf8e3d9a4341801d953fc0f9 (patch)
treea3bf73240fc58959405a72b0b4d1d97c15f6322a /r.html.markdown
parent231388888838b8a00880a431bbc949f525293b88 (diff)
parent38a37135cd1c0f8fd2117adec2177813b8239b54 (diff)
Merge branch 'master' into patch-1
Diffstat (limited to 'r.html.markdown')
-rw-r--r--r.html.markdown10
1 files changed, 6 insertions, 4 deletions
diff --git a/r.html.markdown b/r.html.markdown
index 66e9ba74..9b8420fe 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -4,6 +4,7 @@ contributors:
- ["e99n09", "http://github.com/e99n09"]
- ["isomorphismes", "http://twitter.com/isomorphisms"]
- ["kalinn", "http://github.com/kalinn"]
+ - ["mribeirodantas", "http://github.com/mribeirodantas"]
filename: learnr.r
---
@@ -403,7 +404,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
@@ -476,9 +477,10 @@ class(students[,3]) # "factor"
nrow(students) # 6
ncol(students) # 3
dim(students) # 6 3
-# The data.frame() function converts character vectors to factor vectors
-# by default; turn this off by setting stringsAsFactors = FALSE when
-# you create the data.frame
+# The data.frame() function used to convert character vectors to factor
+# vectors by default; This has changed in R 4.0.0. If your R version is
+# older, turn this off by setting stringsAsFactors = FALSE when you
+# create the data.frame
?data.frame
# There are many twisty ways to subset data frames, all subtly unalike