[R] integer vector to a string

Duncan Murdoch murdoch at stats.uwo.ca
Wed May 10 21:03:24 CEST 2006


On 5/10/2006 2:49 PM, Søren Merser wrote:
> hi there
> is there a way that i can coerce a vector of integers to ONE  string with 
> the numbers comma separated like:
> 1:500  ->    "1,2,3, ..., 500"
> 
> i've tried deparse, but it divides the result into a vector of string 
> (depending on the setting of width with a max of 500)

paste(1:500, collapse=",")

Duncan Murdoch




More information about the R-help mailing list