Manage multiple TealDataConnector
, TealDatasetConnector
and TealDataset
objects.
TealData.Rd
Class manages TealDataConnector
, TealDatasetConnector
and
TealDataset
objects and aggregate them in one collection.
Class also decides whether to launch app before initialize teal application.
Super class
teal.data::TealDataAbstract
-> TealData
Methods
Inherited methods
teal.data::TealDataAbstract$check()
teal.data::TealDataAbstract$check_reproducibility()
teal.data::TealDataAbstract$execute_mutate()
teal.data::TealDataAbstract$get_check()
teal.data::TealDataAbstract$get_check_result()
teal.data::TealDataAbstract$get_code()
teal.data::TealDataAbstract$get_code_class()
teal.data::TealDataAbstract$get_dataset()
teal.data::TealDataAbstract$get_datasets()
teal.data::TealDataAbstract$is_pulled()
teal.data::TealDataAbstract$mutate()
teal.data::TealDataAbstract$mutate_dataset()
teal.data::TealDataAbstract$reassign_datasets_vars()
teal.data::TealDataAbstract$set_check()
teal.data::TealDataAbstract$set_pull_code()
Method new()
Create a new object of TealData
class
Usage
TealData$new(..., check = FALSE, join_keys)
Arguments
...
(
TealDataConnector
,TealDataset
,TealDatasetConnector
)
objectscheck
(
logical
) reproducibility check - whether evaluated preprocessing code gives the same objects as provided in arguments. Check is run only if flag is true and preprocessing code is not empty.join_keys
(
JoinKeys
) or a single (JoinKeySet
)
(optional) object with dataset column relationships used for joining. If empty then no joins between pairs of objects
Method copy()
Creates a copy of the object with keeping valid references
between TealDataset
and TealDatasetConnector
objects
Method print()
Prints this TealData
.
Method get_items()
Get all datasets and all dataset connectors
Method get_ui()
Get a shiny-module UI to render the necessary app to
derive TealDataConnector
object's data
Method get_server()
Get a shiny-module server to render the necessary app to
derive TealDataConnector
object's data
Method launch()
Launch an app that allows to run the user-interfaces of all
TealDataConnector
and TealDatasetConnector
modules
This piece is mainly used for debugging.
Method mutate_join_keys()
Change join_keys for a given pair of dataset names
Examples
library(scda)
#>
adsl_cf <- callable_function(function() synthetic_cdisc_data("latest")$adsl)
adlb_cf <- callable_function(function() synthetic_cdisc_data("latest")$adlb)
adrs_cf <- callable_function(function() synthetic_cdisc_data("latest")$adrs)
adtte_cf <- callable_function(function() synthetic_cdisc_data("latest")$adtte)
x1 <- cdisc_dataset_connector("ADSL", adsl_cf, keys = get_cdisc_keys("ADSL"))
x2 <- cdisc_dataset_connector("ADRS", adrs_cf, keys = get_cdisc_keys("ADRS"))
x3 <- cdisc_dataset(
dataname = "ADAE",
x = synthetic_cdisc_data("latest")$adae,
code = "library(scda)\nADAE <- synthetic_cdisc_data(\"latest\")$adae"
)
x4 <- cdisc_dataset_connector("ADTTE", adtte_cf, keys = get_cdisc_keys("ADTTE"))
tc <- teal.data:::TealData$new(x1, x2, x3, x4)
tc$get_datanames()
#> [1] "ADSL" "ADRS" "ADAE" "ADTTE"
if (FALSE) {
tc$launch()
get_datasets(tc) # equivalent to tc$get_datasets()
tc$get_dataset("ADAE")
tc$check()
}
x <- cdisc_dataset(
dataname = "ADSL",
x = synthetic_cdisc_data("latest")$adsl,
code = "library(scda)\nADSL <- synthetic_cdisc_data(\"latest\")$adsl"
)
x2 <- cdisc_dataset_connector("ADTTE", adtte_cf, keys = get_cdisc_keys("ADTTE"))
tc <- teal.data:::TealData$new(x, x2)
if (FALSE) {
# This errors as we have not pulled the data
# tc$get_datasets()
# pull the data and then we can get the datasets
tc$launch()
tc$get_datasets()
get_raw_data(tc)
}