This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,3 @@
str1 <- "the quick brown fox, etc."
str2 <- 'the quick brown fox, etc.'
identical(str1, str2) #returns TRUE

View file

@ -0,0 +1,6 @@
modestring <- 'row,col'
mode.vec <- unlist(strsplit(modestring, ','))
mode.vec[1] # "row"
mode.vec[2] # "col"
if (mode.vec[2] == 'col') { cat('Col!\n') } # Col! (with no quotes)
if (mode.vec[1] == "row") { cat('Row!\n') } # Row!

View file

@ -0,0 +1,3 @@
`a b` <- 4
`a b` # 4
a b # Error: unexpected symbol in "a b"

View file

@ -0,0 +1,2 @@
options(useFancyQuotes=FALSE)
cat("plain quotes: ", dQuote("double"), "and", sQuote("single"), "\n")

View file

@ -0,0 +1,2 @@
options(useFancyQuotes=TRUE)
cat("fancy quotes: ", dQuote("double"), "and", sQuote("single"), "\n")

View file

@ -0,0 +1,2 @@
options(useFancyQuotes="TeX")
cat("fancy quotes: ", dQuote("double"), "and", sQuote("single"), "\n")