An R6 Object that tracks bindings of a list-like object. This includes DFrame objects. There are several inherited environments that the data is stored within.
Environments:
.shared_env –> curr_group_ctx –> foreign –> lazy –> chops –> active_mask
.shared_env : environment provided at initialization. This may be shared with multiple other BiocDataMasks.
curr_group : Currently not used.
foreign : space to put foreign bindings, i.e. object unrelated to
.data
provided at initialization. This space is currently used to place the pronouns into related contexts.lazy : A strict lazy binding to the data within
.data
. This binding is made only at initialization.chops : lazy data but chopped into list by
.indices
. New bindings for this BiocDataMask context are expected to be in a "chopped" format and are assigned here.active_mask : An active binding to chops in which the proper list index is used depending on the current group context. The current group context is at this moment determined by the .shared_env NOT the curr_group. I have plans to remove the curr_group environment.
Active bindings
environments
the hierarchy of environments for this mask
names
the associated names of data in mask
ptype
get zero-length slices of underlying data
added
newly added names to the mask holds grouping information for this object foreign bindings
Methods
Method new()
Create a biocmask from .data
. .data
is chopped by
.indices
, and environments are built from .env
Usage
biocmask$new(.data, .indices = NULL, .env_bot, .env_top = .env_bot)
Method on_bind()
appends a callback function that is executed after a value is bound to this mask. Mainly used to inform other masks of new values
Method eval()
evaluates a quoted expression within a new datamask
Examples
# note: this R6 class is not exported at this moment
mask <- getNamespace("biocmask")$biocmask$new(iris,
.env_bot = rlang::env(`biocmask:::ctx:::group_id` = 1L))
mask$eval(quote(Sepal.Width))
#> [1] 3.5 3.0 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 3.7 3.4 3.0 3.0 4.0 4.4 3.9 3.5
#> [19] 3.8 3.8 3.4 3.7 3.6 3.3 3.4 3.0 3.4 3.5 3.4 3.2 3.1 3.4 4.1 4.2 3.1 3.2
#> [37] 3.5 3.6 3.0 3.4 3.5 2.3 3.2 3.5 3.8 3.0 3.8 3.2 3.7 3.3 3.2 3.2 3.1 2.3
#> [55] 2.8 2.8 3.3 2.4 2.9 2.7 2.0 3.0 2.2 2.9 2.9 3.1 3.0 2.7 2.2 2.5 3.2 2.8
#> [73] 2.5 2.8 2.9 3.0 2.8 3.0 2.9 2.6 2.4 2.4 2.7 2.7 3.0 3.4 3.1 2.3 3.0 2.5
#> [91] 2.6 3.0 2.6 2.3 2.7 3.0 2.9 2.9 2.5 2.8 3.3 2.7 3.0 2.9 3.0 3.0 2.5 2.9
#> [109] 2.5 3.6 3.2 2.7 3.0 2.5 2.8 3.2 3.0 3.8 2.6 2.2 3.2 2.8 2.8 2.7 3.3 3.2
#> [127] 2.8 3.0 2.8 3.0 2.8 3.8 2.8 2.8 2.6 3.0 3.4 3.1 3.0 3.1 3.1 3.1 2.7 3.2
#> [145] 3.3 3.0 2.5 3.0 3.4 3.0