View source: R/choices_labeled.R
variable_choices | R Documentation |
Wrapper on choices_labeled to label variables basing on existing labels in data.
variable_choices(data, subset = NULL, fill = FALSE, key = NULL)
## S3 method for class 'character'
variable_choices(data, subset = NULL, fill = FALSE, key = NULL)
## S3 method for class 'data.frame'
variable_choices(data, subset = NULL, fill = TRUE, key = NULL)
data |
( |
subset |
( See examples for more details. |
fill |
( |
key |
( This is an optional argument, which allows to identify variables associated
with the primary key and display the appropriate icon for them in the
|
Named character
vector with additional attributes or delayed_data
object.
library(teal.data)
ADRS <- teal.transform::rADRS
variable_choices(ADRS)
variable_choices(ADRS, subset = c("PARAM", "PARAMCD"))
variable_choices(ADRS, subset = c("", "PARAM", "PARAMCD"))
variable_choices(
ADRS,
subset = c("", "PARAM", "PARAMCD"),
key = default_cdisc_join_keys["ADRS", "ADRS"]
)
# delayed version
variable_choices("ADRS", subset = c("USUBJID", "STUDYID"))
# functional subset (with delayed data) - return only factor variables
variable_choices("ADRS", subset = function(data) {
idx <- vapply(data, is.factor, logical(1))
names(data)[idx]
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.