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. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.