[R] Add qoutation marks and combine values in a vector

Gabor Grothendieck ggrothendieck at gmail.com
Tue Apr 25 14:05:21 CEST 2006


Use dQuote.  Assuming you have a data frame with the column
as factors:

DF <- data.frame(x = letters)  # test data
levels(DF$x) <- dQuote(levels(DF$x))


On 4/25/06, Jerry Pressnell <jpressnell at westnet.com.au> wrote:
> I wish to place quotation marks around each element of the following
> list;
>
>             X1
> 1  Label 1
> 2  Label 2
> 3  Label 3
> 4  Label 4
>
> and combine the values in the following format for use in another
> function;
>
> c("Label 1","Label 2","Label 3","Label 4")
>
> Many thanks,
>
> Jerry
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list