TealDataAbstract class
TealDataAbstract.RdAbstract 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$datanamevars(named
list))
In case when this object code depends on otherTealDatasetobject(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 needsADSLobject we should specifyvars = list(ADSL = <adsl object>). It's recommended to includeTealDatasetorTealDatasetConnectorobjects to thevarslist to preserve reproducibility. Please note thatvarsare included to this object as localvarsand 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$datanamevars(named
list))
In case when this object code depends on otherTealDatasetobject(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 needsADSLobject we should specifyvars = list(ADSL = <adsl object>). It's recommended to includeTealDatasetorTealDatasetConnectorobjects to thevarslist to preserve reproducibility. Please note thatvarsare included to this object as localvarsand 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.