[R] converting a row of a data.frame to a vector
Horace Tso
Horace.Tso at pgn.com
Wed May 16 01:46:49 CEST 2007
probably something like,
unlist(x[1,])
HTH.
H.
>>> "Andrew Yee" <yee at post.harvard.edu> 5/15/2007 4:37 PM >>>
I've searched for the answer to this in the help list archive, but wasn't
able to get the answer to work.
I'm interested in converting a row of a data.frame into a vector.
However, when I use as.vector(x,[1,]) I get another data.frame, instead of a
vector. (On the other hand, when I use as.vector(x,[,1]), I get a vector.)
Thanks,
Andrew
[[alternative HTML version deleted]]
______________________________________________
R-help at 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
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list