Re: [R] integer vector to a string

From: Dimitrios Rizopoulos <Dimitris.Rizopoulos_at_med.kuleuven.be>
Date: Thu 11 May 2006 - 05:11:11 EST

probably you need ?paste, e.g.,

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

I hope it helps.

Best,
Dimitris

Quoting Søren Merser <merser@image.dk>:

> 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)
>
> regards soren
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 11 05:24:09 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 11 May 2006 - 06:10:04 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.