Remove quotes from a character vector in R -
suppose have character vector:
char <- c("one", "two", "three") when make reference index value, following:
> char[1] [1] "one" how can strip off quote marks return value following?
[1] 1
as.name(char[1]) work, although i'm not sure why you'd ever want -- quotes won't carried on in paste example:
> paste("i counting to", char[1], char[2], char[3]) [1] "i counting 1 2 three"
Comments
Post a Comment