R6 Class representing a dataset with parent attribute
CDISCTealDataset.Rd
Any
data.frame object can be stored inside this object.
The difference compared to TealDataset class is a parent field that
indicates name of the parent dataset. Note that the parent field might
be empty (i.e. character(0)).
Super class
teal.data::TealDataset -> CDISCTealDataset
Methods
Inherited methods
teal.data::TealDataset$check()teal.data::TealDataset$check_keys()teal.data::TealDataset$get_character_colnames()teal.data::TealDataset$get_code()teal.data::TealDataset$get_code_class()teal.data::TealDataset$get_colnames()teal.data::TealDataset$get_column_labels()teal.data::TealDataset$get_dataname()teal.data::TealDataset$get_datanames()teal.data::TealDataset$get_dataset()teal.data::TealDataset$get_dataset_label()teal.data::TealDataset$get_factor_colnames()teal.data::TealDataset$get_hash()teal.data::TealDataset$get_join_keys()teal.data::TealDataset$get_keys()teal.data::TealDataset$get_metadata()teal.data::TealDataset$get_mutate_code_class()teal.data::TealDataset$get_mutate_vars()teal.data::TealDataset$get_ncol()teal.data::TealDataset$get_nrow()teal.data::TealDataset$get_numeric_colnames()teal.data::TealDataset$get_raw_data()teal.data::TealDataset$get_row_labels()teal.data::TealDataset$get_rownames()teal.data::TealDataset$get_var_r6()teal.data::TealDataset$get_vars()teal.data::TealDataset$is_mutate_delayed()teal.data::TealDataset$is_pulled()teal.data::TealDataset$merge_join_keys()teal.data::TealDataset$mutate()teal.data::TealDataset$mutate_join_keys()teal.data::TealDataset$print()teal.data::TealDataset$reassign_datasets_vars()teal.data::TealDataset$set_code()teal.data::TealDataset$set_dataset_label()teal.data::TealDataset$set_join_keys()teal.data::TealDataset$set_keys()teal.data::TealDataset$set_vars()
Method new()
Create a new object of CDISCTealDataset class
Usage
CDISCTealDataset$new(
dataname,
x,
keys,
parent,
code = character(0),
label = character(0),
vars = list(),
metadata = NULL
)Arguments
dataname(
character)
A given name for the dataset it may not contain spacesx(
data.frame)keys(
character)
vector with primary keysparentoptional, (
character)
parent dataset namecode(
character)
A character string defining the code needed to produce the data set inxlabel(
character)
Label to describe the datasetvars(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 is recommended to includeTealDatasetorTealDatasetConnectorobjects to thevarslist to preserve reproducibility. Please note thatvarsare included to this object as localvarsand they cannot be modified within another dataset.metadata(named
listorNULL)
Field containing metadata about the dataset. Each element of the list should be atomic and length one.
Method recreate()
Recreate a dataset with its current attributes This is useful way to have access to class initialize method basing on class object
Usage
CDISCTealDataset$recreate(
dataname = self$get_dataname(),
x = self$get_raw_data(),
keys = self$get_keys(),
parent = self$get_parent(),
code = private$code,
label = self$get_dataset_label(),
vars = list(),
metadata = self$get_metadata()
)Arguments
dataname(
character)
A given name for the dataset it may not contain spacesx(
data.frame)keys(
character)
vector with primary keysparentoptional, (
character)
parent dataset namecode(
character)
A character string defining the code needed to produce the data set inxlabel(
character)
Label to describe the datasetvars(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 is recommended to includeTealDatasetorTealDatasetConnectorobjects to thevarslist to preserve reproducibility. Please note thatvarsare included to this object as localvarsand they cannot be modified within another dataset.metadata(named
listorNULL)
Field containing metadata about the dataset. Each element of the list should be atomic and length one.
Method get_attrs()
Get all dataset attributes
Examples
x <- cdisc_dataset(
dataname = "XYZ",
x = data.frame(x = c(1, 2), y = c("a", "b"), stringsAsFactors = FALSE),
keys = "y",
parent = "ABC",
code = "XYZ <- data.frame(x = c(1, 2), y = c('aa', 'bb'),
stringsAsFactors = FALSE)",
metadata = list(type = "example")
)
x$ncol
#> NULL
x$get_code()
#> [1] "XYZ <- data.frame(x = c(1, 2), y = c(\"aa\", \"bb\"), stringsAsFactors = FALSE)"
x$get_dataname()
#> [1] "XYZ"
x$get_keys()
#> [1] "y"
x$get_parent()
#> [1] "ABC"