Re: [R] Joining elements of an array into a single element

2010-03-10 Thread vega_l
Thank you very much Miguel ! I couldn't believe it was that easy. Luis Vega. --- On Wed, 3/10/10, Miguel Porto wrote: From: Miguel Porto Subject: Re: [R] Joining elements of an array into a single element To: veg...@yahoo.com Cc: r-help@r-project.org Date: Wednesday, March 10, 2010, 8:

Re: [R] Joining elements of an array into a single element

2010-03-10 Thread Miguel Porto
Hello, If you do this after the for loop, you'll get what you want: paste(tre,collapse="") (you can use whatever separator you want in the collapse argument) But you don't even need the for loop, just do this instead of the for loop: paste("con(",p," == ",c,", ",zest,", ",sep="",collapse="") B

[R] Joining elements of an array into a single element

2010-03-10 Thread vega_l
Dear forum: I've been trying like for hours but I cannot solve this. I wonder if you could give me a hand. I would like to combine the following elements of an array which I must generate in order to get the syntax I need for another software, lets say: c<-c(1:7) zest<-c(12,34,45,132,56,23,6)