Re: [R] How to make a vector with string elements without space

2020-05-24 Thread Greg Snow
As Borris mentioned, paste0 works well for this. Another option is the sprintf function: sprintf("c%i", 1:10) For this example they do the same thing, but as things become more complicated sometimes you will want paste0 and sometimes sprintf will be better. Compare the above to sprintf("c%02i",

Re: [R] How to make a vector with string elements without space

2020-05-23 Thread Boris Steipe
The c() is unnecessary. paste() returns a vector. Paste separates elements with " " by default. Set the separator to "" instead. paste("c",1:10, sep = "") ... or use paste0(), which has "" as default separator. paste0("c",1:10) ?paste is your friend. B. > On 2020-05-23, at 22:25, Vahid Bo