Skip to contents

[Experimental] 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)).

Usage

mutate_data(x, code = character(0), script = character(0), vars = list())

# S3 method for TealDataAbstract
mutate_data(x, code = character(0), script = character(0), vars = list())

Arguments

x

(TealDataAbstract)
object.

code

(character)
Code to mutate the dataset. Must contain the dataset$dataname. Or can also be an object of class PythonCodeClass returned by python_code.

script

(character)
file that contains R Code that can be read using read_script. Preferred before code argument.

vars

(named list))
In case when this object code depends on other TealDataset 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 needs ADSL object we should specify vars = list(ADSL = <adsl object>). It's recommended to include TealDataset or TealDatasetConnector objects to the vars list to preserve reproducibility. Please note that vars are included to this object as local vars and they cannot be modified within another dataset.

Value

modified x object