Dictionary {mlr3misc}R Documentation

Key-Value Storage

Description

A key-value store for R6::R6 objects. On retrieval of an object, the following applies:

Default argument required for construction can be stored alongside their constructors by passing them to $add().

Format

R6::R6Class object.

Construction

d = Dictionary$new()

Methods

S3 methods

Examples

library(R6)
item1 = R6Class("Item", public = list(x = 1))
item2 = R6Class("Item", public = list(x = 2))
d = Dictionary$new()
d$add("a", item1)
d$add("b", item2)
d$add("c", item1$new())
d$keys()
d$get("a")
d$mget(c("a", "b"))

[Package mlr3misc version 0.1.3 Index]