DataBackendDataTable: DataBackend for data.table

Description Format Construction Fields Methods See Also Examples

Description

DataBackend for data.table as an in-memory data base.

Format

R6::R6Class object inheriting from DataBackend.

Construction

1
2
DataBackendDataTable$new(data, primary_key = NULL)
as_data_backend(data, primary_key = NULL, ...)

DataBackendDataTable does not copy the input data, while as_data_backend calls data.table::copy(). as_data_backend creates a primary key column as integer column if primary_key is NULL.

Fields

See DataBackend.

Methods

See DataBackend.

See Also

Other DataBackend: DataBackendMatrix, DataBackend, as_data_backend

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data = as.data.table(iris)
data$id = seq_len(nrow(iris))
b = DataBackendDataTable$new(data = data, primary_key = "id")
print(b)
b$head()
b$data(rows = 100:101, cols = "Species")

b$nrow
head(b$rownames)

b$ncol
b$colnames

# alternative construction
as_data_backend(iris)

mllg/mlr3 documentation built on Sept. 27, 2019, 9:38 a.m.