[R] Error when I attempt to create a list or a data frame

JS Huang js.huang at protective.com
Wed Feb 18 00:09:44 CET 2015


Hi,

  It appears that you used left double quotation marks and right double
quotation marks in your vector for characters.  The first lst assignment is
copied from your post and indicates issues.  I retyped with doulbe quotation
mark and went through fine with the second lst assignment.  Unicode for
double quotation mark is U+0022 and for left double quotation mark U+201C
and right double quotation mark U+201D.  Although they look similar but they
are not the same in unicode.

> lst <- list(c(1,2),TRUE,c(“a”,“b”,“c”)) 
Error: unexpected input in "lst <- list(c(1,2),TRUE,c(“"
> lst <- list(c(1,2),TRUE,c("a","b","c"))
> lst
[[1]]
[1] 1 2

[[2]]
[1] TRUE

[[3]]
[1] "a" "b" "c"




--
View this message in context: http://r.789695.n4.nabble.com/Error-when-I-attempt-to-create-a-list-or-a-data-frame-tp4703251p4703433.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list