[R] help with paste

Liaw, Andy andy_liaw at merck.com
Mon Jul 12 15:56:47 CEST 2004


Do you mean something like:

> paste(x$cat, collapse=" ")
[1] "8 2 3 6 1"

??

Andy

> From: Andrew Criswell
> 
> Hello All:
> 
> Suppose the following little data frame:
> 
>  > x <- data.frame(dog = c(3,4,6,2,8), cat = c(8,2,3,6,1))
>  >
>  > x$cat
> [1] 8 2 3 6 1
>  >
> 
> How can I get the paste() function to do the same thing. The command 
> below is obviously wrong
> 
>  > paste(x, cat, sep = "$")
>  >
> 
> Thanks,
> ANDREW




More information about the R-help mailing list