Skip to content
Back to formatted view

Raw Message

Message-ID: <6rhe9fiswo.fsf@bates4.stat.wisc.edu>
Date: 2003-04-03T13:59:03Z
From: Douglas Bates
Subject: Combining the components of a character vector
In-Reply-To: <Pine.A41.4.44.0304021552520.19986-100000@mead5.u.washington.edu>

Use the collapse argument to paste.

> paste(c('Bob', 'loves', 'Sally'), collapse = ' ')
[1] "Bob loves Sally"

John Miyamoto <jmiyamot at u.washington.edu> writes:

>    Suppose I have a character vector.
> 
> x <- c("Bob", "loves", "Sally")
> 
> I want to combine it into a single string:  "Bob loves Sally" .