Skip to content

De-data.fram-ize?

2 messages · Lukasz Komsta, Peter Dalgaard

#
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).

Regards,
#
Lukasz Komsta <luke at novum.am.lublin.pl> writes:
unlist(x) should do it. It does spend a fair bit of effort in adding
names, so it could be less efficient.