mda.df2mat {mdatools} | R Documentation |
Convert data frame to a matrix
Description
The function converts data frame to a numeric matrix.
Usage
mda.df2mat(x, full = FALSE)
Arguments
x |
a data frame |
full |
logical, if TRUE number of dummy variables for a factor will be the same as number of levels, otherwise by one smaller |
Details
If one or several columns of the data frame are factors they will be converted to a set of dummy variables. If any columns/rows were hidden in the data frame they will remain hidden in the matrix. If there are factors among the hidden columns, the corresponding dummy variables will be hidden as well.
All other attributes (names, axis names, etc.) will be inherited.
Value
a numeric matrix
[Package mdatools version 0.14.1 Index]