Reputation: 23898
Desired result:
s1,s2,s3,s4,s5,s6,s7,s8,s9,s10
I want to get a character vector with comma separator and without double quotes using R
paste0
command. MWE is given below:
noquote(paste0("s", 1:10))
Could not figured out how to append comma between two elements of the character vector.
Upvotes: 1
Views: 1501
Reputation: 520948
Try using the collapse
parameter with paste
to concatenate to a single comma separated string.
paste0("s", 1:10, collapse=",")
[1] "s1,s2,s3,s4,s5,s6,s7,s8,s9,s10"
Upvotes: 2