[R] pasting elements of one character vector together
d.rizopoulos at erasmusmc.nl
Mon Sep 19 16:04:39 CEST 2011
object <- c("Hello", "World")
paste(object, collapse = " ")
I hope it helps.
On 9/19/2011 3:58 PM, Marion Wenty wrote:
> i am familiar with the paste command with which i can paste for exaple:
> object<- "Hello"
> now i would like to be able to paste all the elements of the same vector
> together e.g:
> object<- c("Hello","World")
> getting as a result also:
> "Hello World".
> Does anyone know the solution to this problem?
> Thank you very much in advance.
> [[alternative HTML version deleted]]
> 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.
Department of Biostatistics
Erasmus University Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
More information about the R-help