Rilcon42 Rilcon42 - 1 year ago 80
R Question

creating string of numbers seperated by commas

I am trying to create a comma separated string exactly like this to put in a url:

but when I try:
it returns:
[1] "1," "2," "3," "4," "5,"
The spaces are causing issues. How do I get rid of them?

This is not the same question as: this SO post the solution is almost the same, but the question approaches it from a different angle. My question is trying to suppress the spaces, the linked question wants them.

Answer Source

Try to use collapse="," instead of sep=",":

[1] "1,2,3,4,5"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download