Re: [R] integer vector to a string

From: Søren Merser <merser_at_image.dk>
Date: Thu 11 May 2006 - 05:28:03 EST

yes, of cause, i'm sorry, don't what i was thinking about regards
----- Original Message -----
From: "Peter Dalgaard" <p.dalgaard@biostat.ku.dk> To: "Søren Merser" <merser@image.dk>
Cc: "R - help" <r-help@stat.math.ethz.ch> Sent: Wednesday, May 10, 2006 9:06 PM
Subject: Re: [R] integer vector to a string

> Søren Merser <merser@image.dk> writes:
>
>> 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=",")
>
> --
> O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
> c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
> (*) \(*) -- University of Copenhagen Denmark Ph: (+45)
> 35327918
> ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45)
> 35327907



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:37:21 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.