summaryrefslogtreecommitdiffhomepage
path: root/r.html.markdown
diff options
context:
space:
mode:
authorAdnane Hmunna <32016785+Ahmunna@users.noreply.github.com>2020-12-13 15:29:18 +0100
committerGitHub <noreply@github.com>2020-12-13 15:29:18 +0100
commit27f7f03401ff747a61a912fdf73549b1788b13e1 (patch)
tree69d2607dfda179246c2a4579be004775eadf7fe1 /r.html.markdown
parentf6a36081355c8a266b024888aaacb4abf18394a1 (diff)
Update r.html.markdown
Following R best practices, it's recommened to use only double-quotes.
Diffstat (limited to '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 3e855602..2aedf625 100644
--- a/r.html.markdown
+++ b/r.html.markdown
@@ -211,10 +211,10 @@ c(1,2,3,1,2,3) * c(1,2,1,2,1,2)
# 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
@@ -250,8 +250,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