Convert a dataframe to matrix {Rfast} | R Documentation |
Convert a dataframe to matrix
Description
Convert a dataframe to matrix.
Usage
data.frame.to_matrix(x,col.names = NULL,row.names = NULL)
Arguments
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. |
Details
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.
Value
A matrix wich has the numrical values from the dataframe.
Author(s)
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>
See Also
Match, is.symmetric, permutation
Examples
res<-data.frame.to_matrix(iris)
[Package Rfast version 2.1.0 Index]