| to.matrix | R Documentation |
S3 generic; convert to matrix move column to rownamesUseful when working with data.tables; cannot have rownames. Other methods (as.matrix, data.table::setDF) allow to convert to a data.frame but then another step is necessary to move an identifier column to rownames. This function allows the two in one step.
to.matrix(x, ...) ## S3 method for class 'data.table' to.matrix(x, id.col = NULL, drop.id.col = TRUE)
x |
type: data.table A |
... |
matrix
Dereck de Mezquita
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.