[R] help with paste

1Rnwb sbpurohit at gmail.com
Thu Oct 27 03:03:36 CEST 2011


Hello gurus,

I have some variables, and i am creating combinations for analysis in the
end i need these variables to be displayed like "LEPTIN+SAA+PTH". currently
i am using loop to perform this. I would appreciate any pointers to do it
without the loop.

> mols=c("LEPTIN","SAA","PTH","sEGFR")
> samples=mols[1:3]
> samples
[1] "LEPTIN" "SAA"    "PTH"   
> names1=samples[1]
>  for (j in 2:length(samples)){ names1 = paste (names1, samples[j],
> sep="+")}
> names1
[1] "LEPTIN+SAA+PTH"
> 
thanks
sharad

--
View this message in context: http://r.789695.n4.nabble.com/help-with-paste-tp3942818p3942818.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list