TealDataAbstract
class
TealDataAbstract.Rd
Abstract class containing code for handling set of datasets.
Methods
Method check()
Check if the object raw data is reproducible from the get_code()
code.
Returns
NULL
if check step has been disabled
TRUE
if all the datasets generated from evaluating the
get_code()
code are identical to the raw data, else FALSE
.
Method check_reproducibility()
Execute check()
and raise an error if it's not reproducible.
Method execute_mutate()
Execute mutate code. Using mutate_data(set).TealDataAbstract
does not cause instant execution, the mutate_code
is
delayed and can be evaluated using this method.
Method get_code()
Get code for all datasets.
Method get_code_class()
Get internal CodeClass
object
Method get_dataset()
Get TealDataset
object.
Method get_datasets()
Get list
of TealDataset
objects.
Method get_items()
Get all datasets and all dataset connectors
Method is_pulled()
Check if dataset has already been pulled.
Method mutate()
Mutate data by code. Code used in this mutation is not linked to particular
but refers to all datasets.
Consequence of this is that when using get_code(<dataset>)
this
part of the code will be returned for each specified dataset. This method
should be used only if particular call involve changing multiple datasets.
Otherwise please use mutate_dataset
.
Execution of mutate_code
is delayed after datasets are pulled
(isTRUE(is_pulled)
).
Usage
TealDataAbstract$mutate(code, vars = list())
Arguments
code
(
character
) Code to mutate the dataset. Must contain thedataset$dataname
vars
(named
list
))
In case when this object code depends on otherTealDataset
object(s) or other constant value, this/these object(s) should be included as named element(s) of the list. For example if this object code needsADSL
object we should specifyvars = list(ADSL = <adsl object>)
. It's recommended to includeTealDataset
orTealDatasetConnector
objects to thevars
list to preserve reproducibility. Please note thatvars
are included to this object as localvars
and they cannot be modified within another dataset.
Method mutate_dataset()
Mutate dataset by code.
Execution of mutate_code
is delayed after datasets are pulled
(isTRUE(is_pulled)
).
Usage
TealDataAbstract$mutate_dataset(dataname, code, vars = list())
Arguments
dataname
(
character
) Dataname to be mutatedcode
(
character
) Code to mutate the dataset. Must contain thedataset$dataname
vars
(named
list
))
In case when this object code depends on otherTealDataset
object(s) or other constant value, this/these object(s) should be included as named element(s) of the list. For example if this object code needsADSL
object we should specifyvars = list(ADSL = <adsl object>)
. It's recommended to includeTealDataset
orTealDatasetConnector
objects to thevars
list to preserve reproducibility. Please note thatvars
are included to this object as localvars
and they cannot be modified within another dataset.
Method set_pull_code()
Set pull code
Method reassign_datasets_vars()
Reassign vars
in TealDataset
and TealDatasetConnector
objects
to keep the valid reference after deep cloning
For example if TealDatasetConnector
has a dependency on some TealDataset
, this
TealDataset
is reassigned inside of TealDatasetConnector
.