Re: [R] De-data.fram-ize?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Sat 17 Sep 2005 - 05:36:53 EST

Lukasz Komsta <luke@novum.am.lublin.pl> writes:

> Dear useRs,
>
> Is there any more elegant way to convert dataframe to a vector of all
> its values than as.vector(as.matrix(x)) ? I did not have to do such
> conversion yet, so I am not sure... (of course as.vector() alone does
> not work).

unlist(x) should do it. It does spend a fair bit of effort in adding names, so it could be less efficient.

-- 
   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 Wed Sep 21 02:03:34 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:08:21 EST