summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarcel Ribeiro Dantas <ribeirodantasdm@gmail.com>2022-06-27 00:30:18 +0200
committerGitHub <noreply@github.com>2022-06-27 00:30:18 +0200
commitf6f2aaafda5113c9468ff524ba1f372441ffd960 (patch)
tree7ebc7704f02ceef195a8896a80a06ed81cc12585
parent8f28c8021b8ce3cb791861ad19c41e12228d8bcd (diff)
parent5d133e847846b4c8d436f7a567674c2e1df35a13 (diff)
Merge pull request #4070 from Ahmunna/patch-1
[R/en] Update r.html.markdown
-rw-r--r--r.html.markdown8
1 files changed, 4 insertions, 4 deletions
diff --git a/r.html.markdown b/r.html.markdown
index 9b8420fe..2746d1eb 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -213,10 +213,10 @@ c(1, 2, 3, 1, 2, 3) * c(1, 2, 1, 2, 1, 2) # 1 4 3 2 2 6
# There's no difference between strings and characters in R
"Horatio" # "Horatio"
class("Horatio") # "character"
-class('H') # "character"
+class("H") # "character"
# Those were both character vectors of length 1
# Here is a longer one:
-c('alef', 'bet', 'gimmel', 'dalet', 'he')
+c("alef", "bet", "gimmel", "dalet", "he")
# => "alef" "bet" "gimmel" "dalet" "he"
length(c("Call","me","Ishmael")) # 3
# You can do regex operations on character vectors:
@@ -252,8 +252,8 @@ c(TRUE, FALSE, TRUE) & c(FALSE, TRUE, TRUE) # FALSE FALSE TRUE
# You can test if x is TRUE
isTRUE(TRUE) # TRUE
# Here we get a logical vector with many elements:
-c('Z', 'o', 'r', 'r', 'o') == "Zorro" # FALSE FALSE FALSE FALSE FALSE
-c('Z', 'o', 'r', 'r', 'o') == "Z" # TRUE FALSE FALSE FALSE FALSE
+c("Z", "o", "r", "r", "o") == "Zorro" # FALSE FALSE FALSE FALSE FALSE
+c("Z", "o", "r", "r", "o") == "Z" # TRUE FALSE FALSE FALSE FALSE
# FACTORS
# The factor class is for categorical data