Mutate data by code
mutate_data.Rd
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 dataset specified. This method
should be used only if particular call involve changing multiple datasets.
Otherwise please use mutate_dataset
.
Execution of the code is delayed after datasets are pulled
(isTRUE(is_pulled)
).
Arguments
- x
(
TealDataAbstract
)
object.- code
(
character
)
Code to mutate the dataset. Must contain thedataset$dataname
. Or can also be an object of classPythonCodeClass
returned bypython_code
.- script
(
character
)
file that contains R Code that can be read usingread_script
. Preferred beforecode
argument.- 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.