November 4, 2013

Convert a dataframe to a vector in R

It is not possible to convert a dataframe directly to a vector. However, a dataframe can first be converted to a matrix and then to a vector.

 as.vector(as.matrix(myDataFrame))  

No comments:

Post a Comment