View source: R/data.frame.to_matrix.R
Convert a dataframe to matrix | R Documentation |
Convert a dataframe to matrix.
data.frame.to_matrix(x,col.names = NULL,row.names = NULL)
x |
A Numeric matrix with data and NAs. |
col.names |
A boolean value for keeping the colnames for argument x or a character vector for the new colnames. |
row.names |
A boolean value for keeping the rownames for argument x or a character vector for the new rownames. |
This functions converts a dataframe to matrix. Even if there are factors, the function converts them into numerical values. Attributes are not allowed for now.
A matrix wich has the numrical values from the dataframe.
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>
Match, is.symmetric, permutation
res<-data.frame.to_matrix(iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.