Re: [R] integer vector to a string

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Thu 11 May 2006 - 05:06:53 EST

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:20:06 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.