as_data_backend.Matrix {mlr3} | R Documentation |
Create a Data Backend
Description
Wraps a DataBackend around data.
mlr3 ships with methods for data.frame
(converted to a DataBackendDataTable
and Matrix
from package Matrix (converted to a DataBackendMatrix).
Additional methods are implemented in the package mlr3db, e.g. to connect to real DBMS like PostgreSQL (via dbplyr) or DuckDB (via DBI/duckdb).
Usage
## S3 method for class 'Matrix'
as_data_backend(data, primary_key = NULL, dense = NULL, ...)
as_data_backend(data, primary_key = NULL, ...)
## S3 method for class 'data.frame'
as_data_backend(data, primary_key = NULL, keep_rownames = FALSE, ...)
Arguments
data |
( |
primary_key |
( |
dense |
( |
... |
(any) |
keep_rownames |
( |
Value
See Also
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter10/advanced_technical_aspects_of_mlr3.html#sec-backends
Package mlr3db to interface out-of-memory data, e.g. SQL servers or duckdb.
Other DataBackend:
DataBackend
,
DataBackendDataTable
,
DataBackendMatrix
Examples
# create a new backend using the penguins data:
as_data_backend(palmerpenguins::penguins)