Converts a dbMatrix object into an in-memory matrix or sparse matrix.
Usage
# S3 method for class 'dbMatrix'
as.matrix(x, ..., sparse = FALSE, names = TRUE)Arguments
- x
A
dbMatrixobject (dbSparseMatrix or dbDenseMatrix)- ...
Additional arguments (not used)
- sparse
Logical indicating if the output should be a sparse matrix
default:FALSE- names
Logical indicating if the output should have dimnames.
default:FALSE
Value
A Matrix::dgCMatrix or matrix
Details
This method converts a dbMatrix object into an in-memory
Matrix::dgCMatrix (sparse = TRUE) or matrix() (default, sparse = FALSE).
Warning: This function can cause memory issues for large dbMatrix objects.
Set sparse = TRUE to convert to a sparse matrix.
Set names = TRUE to keep dimnames.