[R] Combining the components of a character vector

Ido M. Tamir tamir at imp.univie.ac.at
Thu Apr 3 15:01:29 CEST 2003


On Thursday 03 Apr 2003 1:54 am, John Miyamoto wrote:
> Dear Help,
>    Suppose I have a character vector.
>
> x <- c("Bob", "loves", "Sally")
>
> I want to combine it into a single string:  "Bob loves Sally" .

y <- paste(c, collapse=" ")

best wishes

Ido



More information about the R-help mailing list