[R] Lists to vectors...

Marc Schwartz mschwartz at medanalytics.com
Thu Sep 26 04:29:07 CEST 2002


> -----Original Message-----
> From: owner-r-help at stat.math.ethz.ch [mailto:owner-r-
> help at stat.math.ethz.ch] On Behalf Of Kevin Karty
> Sent: Wednesday, September 25, 2002 7:44 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] Lists to vectors...
> 
> 
> 
> Hello, can anyone answer:
> 
> Is there a fast, vectorized way to convert a list of integer vectors,
in
> which each vector has different length, to a single vector that is
> simply the concatenation of all the member vectors?  Or does one have
to
> loop over the list and concatenate everything?

If your list is "x":

How about unlist(x, recursive = TRUE)

See ?unlist

Marc



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list