Re: [R] concatenate values in the vector

2010-08-03 Thread J . delasHeras
e Dallazuanna Enviado el: Martes, 03 de Agosto de 2010 04:37 p.m. Para: phoebe kong CC: r-help Asunto: Re: [R] concatenate values in the vector Try this: paste(x, collapse = '+') On Tue, Aug 3, 2010 at 5:34 PM, phoebe kong wrote: Hi all, Is there a function that allow me to

Re: [R] concatenate values in the vector

2010-08-03 Thread Erik Iverson
Cristian Montes wrote: Ok, sorry, I misinterpreted the question! Here is the right solution x <- c("a", "b", "c", "d", "e") z <- x[1] for (i in 2:length(x)) { z<- paste(z, x[i], sep = "+") } print(z) [1] "a+b+c+d+e" Or paste(x, collapse = '+') which was the solution that

Re: [R] concatenate values in the vector

2010-08-03 Thread Cristian Montes
ers, Cristián. -Mensaje original- De: David Winsemius [mailto:dwinsem...@comcast.net] Enviado el: Martes, 03 de Agosto de 2010 05:26 p.m. Para: Cristian Montes CC: Henrique Dallazuanna; r-help Asunto: Re: [R] concatenate values in the vector On Aug 3, 2010, at 5:17 PM, Cristian Montes wrot

Re: [R] concatenate values in the vector

2010-08-03 Thread David Winsemius
aje original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] En nombre de Henrique Dallazuanna Enviado el: Martes, 03 de Agosto de 2010 04:37 p.m. Para: phoebe kong CC: r-help Asunto: Re: [R] concatenate values in the vector Try this: paste(x, collapse = '+')

Re: [R] concatenate values in the vector

2010-08-03 Thread Erik Iverson
Cristian Montes wrote: Even shorter is x<-c("a","b","c","d") paste(x, sep="+") > x<-c("a","b","c","d") > paste(x, sep="+") [1] "a" "b" "c" "d" __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the po

Re: [R] concatenate values in the vector

2010-08-03 Thread Cristian Montes
gosto de 2010 04:37 p.m. Para: phoebe kong CC: r-help Asunto: Re: [R] concatenate values in the vector Try this: paste(x, collapse = '+') On Tue, Aug 3, 2010 at 5:34 PM, phoebe kong wrote: > Hi all, > > Is there a function that allow me to concatenate each value in a >

Re: [R] concatenate values in the vector

2010-08-03 Thread Henrique Dallazuanna
Try this: paste(x, collapse = '+') On Tue, Aug 3, 2010 at 5:34 PM, phoebe kong wrote: > Hi all, > > Is there a function that allow me to concatenate each value in a vector to > a > string? > > x<-c("a","b","c","d") > > output string = a+b+c+d > > Thanks, > phoebe > >[[alternative HTML v

[R] concatenate values in the vector

2010-08-03 Thread phoebe kong
Hi all, Is there a function that allow me to concatenate each value in a vector to a string? x<-c("a","b","c","d") output string = a+b+c+d Thanks, phoebe [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.