Get dataset primary keys
get_keys.Rd
Usage
get_keys(x, ...)
# S3 method for TealDataset
get_keys(x, ...)
# S3 method for TealDatasetConnector
get_keys(x, ...)
# S3 method for TealDataAbstract
get_keys(x, dataname, ...)
Arguments
- x
an object of
TealDataset
orTealDatasetConnector
class- ...
not used, only for support of S3
- dataname
(
character
) name of dataset to return keys for
Examples
# TealDataset --------
get_keys(
dataset(
"ADSL",
teal.data::example_cdisc_data("ADSL"),
keys = get_cdisc_keys("ADSL"),
code = "ADSL <- teal.data::example_cdisc_data(\"ADSL\")"
)
)
#> [1] "STUDYID" "USUBJID"
# TealDatasetConnector --------
library(magrittr)
pull_fun_adsl <- callable_function(teal.data::example_cdisc_data) %>%
set_args(list(dataname = "ADAE"))
get_keys(
dataset_connector(
"ADSL",
pull_fun_adsl,
keys = get_cdisc_keys("ADSL"),
)
)
#> [1] "STUDYID" "USUBJID"
# TealData --------
get_keys(
teal_data(
dataset("x", data.frame(x1 = 1:10, y1 = 11:20), keys = "x1"),
dataset("y", data.frame(x2 = 1:10, y2 = 11:20), keys = "x2")
),
"x"
)
#> [1] "x1"