I think you want to paste together the elements of a vector like 1:2
to get a comma separated string. To do this you use the collapse
argument of paste, since you are passing it only a single argument.
paste(1:3, collapse = ",")
[1] "1,2,3"
On the other hand if you passed multiple terms you would use sep
:
paste(1, 2, 3, sep = ",")
[1] "1,2,3"
sep
separates the arguments, collapse
separates the components of vector arguments. For example:
paste(1:4, 5:8, collapse=",", sep="|")
[1] "1|5,2|6,3|7,4|8"
Type ?paste
at the R prompt for more information.
So you want
paste(1:pred.size, collapse=",")
Your c
is not necessary because 1:pred_size
is already a vector.