[R] help with paste

Liaw, Andy andy_liaw at merck.com
Mon Jul 12 16:13:18 CEST 2004


Now that I see Duncan's reply, I believe that's what Andrew wanted.  I
really should read messages more carefully...

Andy

> From: Liaw, Andy
> 
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
> --------------------------------------------------------------
> ----------------
> Notice:  This e-mail message, together with any attachments, 
> contains information of Merck & Co., Inc. (One Merck Drive, 
> Whitehouse Station, New Jersey, USA 08889), and/or its 
> affiliates (which may be known outside the United States as 
> Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
> Banyu) that may be confidential, proprietary copyrighted 
> and/or legally privileged. It is intended solely for the use 
> of the individual or entity named on this message.  If you 
> are not the intended recipient, and have received this 
> message in error, please notify us immediately by reply 
> e-mail and then delete it from your system.
> --------------------------------------------------------------
> ----------------
>




More information about the R-help mailing list