[R] paste command with new line separator

From: slurpy <sunayan_at_gmail.com>
Date: Mon, 17 Nov 2008 12:03:07 -0800 (PST)

Win xp sp2, R v2.7.1
Hi. If I have two numeric columns in a data frame, I can use the paste command to combine them into a new column separated by a comma. c3=paste(c1,c2,sep=',')
gives: 1 1 -> "1,1"
Is there any way I can use a new line (\n) as a separator? i.e.
1 1 -> 1

I tried paste(1,1,'\n') but it only gives "1\n1" Is there any other command for this? I tried cat but it doesn't work for columns.
Sorry if its already answered somewhere else, but I couldn't find it. Thanks.

View this message in context: http://www.nabble.com/paste-command-with-new-line-separator-tp20546923p20546923.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 17 Nov 2008 - 20:12:06 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Nov 2008 - 21:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive