The easiest thing to do is add a second paste statement: > paste(s, paste(middle, collapse=" "), e, sep=" ") [1] "start 1 2 3 end" > paste(s, paste(middle, collapse=","), e, sep=" ") [1] "start 1,2,3 end" > paste(s, paste(middle, collapse=", "), e, sep=" ") [1] "start 1, 2, 3 end"
On Fri, Feb 25, 2011 at 5:21 PM, Dimitri Liakhovitski <dimitri.liakhovit...@gmail.com> wrote: > 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! > -- -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ 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.