Skip to contents

Abstract class containing code for handling set of datasets.

Public fields

id

String used to create unique GUI elements

Methods


Method new()

Cannot create a TealDataAbstract object

Usage

Returns

throws error


Method check()

Check if the object raw data is reproducible from the get_code() code.

Usage

TealDataAbstract$check()

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.

Usage

TealDataAbstract$check_reproducibility()

Returns

error if code is not reproducible else invisibly nothing


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.

Usage

TealDataAbstract$execute_mutate()


Method get_check_result()

Get result of reproducibility check

Usage

TealDataAbstract$get_check_result()

Returns

NULL if check has not been called yet, TRUE / FALSE otherwise


Method get_code()

Get code for all datasets.

Usage

TealDataAbstract$get_code(dataname = NULL, deparse = TRUE)

Arguments

dataname

(character) dataname or NULL for all datasets

deparse

(logical) whether to return the deparsed form of a call

Returns

(character) vector of code to generate datasets.


Method get_code_class()

Get internal CodeClass object

Usage

TealDataAbstract$get_code_class(only_pull = FALSE)

Arguments

only_pull

(logical value)
if TRUE only code to pull datasets will be returned without the mutate code.

Returns

CodeClass


Method get_datanames()

Get names of the datasets.

Usage

TealDataAbstract$get_datanames()

Returns

character vector with names of all datasets.


Method get_dataset()

Get TealDataset object.

Usage

TealDataAbstract$get_dataset(dataname = NULL)

Arguments

dataname

(character value)
name of dataset to be returned. If NULL, all datasets are returned.

Returns

TealDataset.


Method get_datasets()

Get list of TealDataset objects.

Usage

TealDataAbstract$get_datasets()

Returns

list of TealDataset.


Method get_items()

Get all datasets and all dataset connectors

Usage

TealDataAbstract$get_items(dataname = NULL)

Arguments

dataname

(character value)
name of dataset connector to be returned. If NULL, all connectors are returned.

Returns

list with all datasets and all connectors


Method get_check()

Has this data been or will this data be subjected to a reproducibility check

Usage

TealDataAbstract$get_check()

Returns

logical


Method is_pulled()

Check if dataset has already been pulled.

Usage

TealDataAbstract$is_pulled()

Returns

TRUE if dataset has been already pulled, else FALSE


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 the dataset$dataname

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.

Returns

self invisibly for chaining


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 mutated

code

(character) Code to mutate the dataset. Must contain the dataset$dataname

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.

Returns

self invisibly for chaining


Method set_check()

Set reproducibility check

Usage

TealDataAbstract$set_check(check = FALSE)

Arguments

check

(logical) whether to perform reproducibility check.

Returns

(self) invisibly for chaining.


Method set_pull_code()

Set pull code

Usage

TealDataAbstract$set_pull_code(code)

Arguments

code

(character value)
code to reproduce data in TealDataset objects. Can't be set if any dataset has code set already.

Returns

(self) invisibly for chaining.


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.

Usage

TealDataAbstract$reassign_datasets_vars()


Method clone()

The objects of this class are cloneable with this method.

Usage

TealDataAbstract$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.