[R] preventing repeat in "paste"

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Fri Feb 25 23:21:40 CET 2011


Hello!

s<-"start"; e<-"end"
middle<-as.character(c(1,2,3))

I would like to get the following result:
"start 123 end" or "start 1 2 3 end" or "start 1,2,3 end"

How can I avoide this (undesired) result:
paste(s,middle,e,sep=" ")


Thank you!
-- 
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com



More information about the R-help mailing list