[R] string

(Ted Harding) ted.harding at wlandres.net
Tue Dec 7 16:38:48 CET 2010


Ivan's advice is good, but understanding clearly what
"character string to separate the results" might mean is
a bit tricky!

Example:

  cvec <- c("J","e"," ","m","'","a","p","p","e","l","l","e",
            " ","B","e","n","o","i","t")
  cstring <- paste(cvec,collapse="")
  cstring
  # [1] "Je m'appelle Benoit"

Now try it without the 'collapse=""'.

Hoping this helps,
Ted.

On 07-Dec-10 15:19:39, Ivan Calandra wrote:
> Hi,
> If I understand what you mean (no example...), see ?paste and the 
> collpase argument
> Ivan
> 
> Le 12/7/2010 16:11, Benoit Wastine a écrit :
>> Hi,
>>
>> I'm running R 2.11
>> Does anyone know if it possible to transform one character vector to 
>> one character string ?
>>
>> Many thanks
>> Benoit
> -- 
> Ivan CALANDRA

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.harding at wlandres.net>
Fax-to-email: +44 (0)870 094 0861
Date: 07-Dec-10                                       Time: 15:38:44
------------------------------ XFMail ------------------------------



More information about the R-help mailing list