[R] Is there a function that print a string vertically (by adding \n)?

2013-04-29 Thread jpm miao
Hi, I'd like to print a string vertically. For example, I would like to print abcd as a\nb\nc\nd Is there a function in R such that Input: abcd Output: a\nb\nc\nd? Thanks, Miao [[alternative HTML version deleted]] __

Re: [R] Is there a function that print a string vertically (by adding \n)?

2013-04-29 Thread arun
Hi, May be this helps:  cat(paste(strsplit(abcd,)[[1]],collapse=\n)) #a #b #c #d A.K. - Original Message - From: jpm miao miao...@gmail.com To: r-help r-help@r-project.org Cc: Sent: Monday, April 29, 2013 9:41 PM Subject: [R] Is there a function that print a string vertically (by

Re: [R] Is there a function that print a string vertically (by adding \n)?

2013-04-29 Thread David Winsemius
On Apr 29, 2013, at 6:41 PM, jpm miao wrote: Hi, I'd like to print a string vertically. For example, I would like to print abcd as a\nb\nc\nd Is there a function in R such that Input: abcd Output: a\nb\nc\nd? do.call( paste, list( strsplit(abcd, )[[1]] , collapse=\\n)) [1]

Re: [R] Is there a function that print a string vertically (by adding \n)?

2013-04-29 Thread David Winsemius
On Apr 29, 2013, at 6:50 PM, David Winsemius wrote: On Apr 29, 2013, at 6:41 PM, jpm miao wrote: Hi, I'd like to print a string vertically. For example, I would like to print abcd as a\nb\nc\nd Is there a function in R such that Input: abcd Output: a\nb\nc\nd? do.call(