View source: R/choices_labeled.R
value_choices | R Documentation |
Wrapper on choices_labeled to label variable values basing on other variable values.
value_choices(data, var_choices, var_label = NULL, subset = NULL, sep = " - ")
## S3 method for class 'character'
value_choices(data, var_choices, var_label = NULL, subset = NULL, sep = " - ")
## S3 method for class 'data.frame'
value_choices(data, var_choices, var_label = NULL, subset = NULL, sep = " - ")
data |
( |
var_choices |
( |
var_label |
( |
subset |
( See examples for more details. |
sep |
( |
named character vector or delayed_data
object.
ADRS <- teal.transform::rADRS
value_choices(ADRS, "PARAMCD", "PARAM", subset = c("BESRSPI", "INVET"))
value_choices(ADRS, c("PARAMCD", "ARMCD"), c("PARAM", "ARM"))
value_choices(ADRS, c("PARAMCD", "ARMCD"), c("PARAM", "ARM"),
subset = c("BESRSPI - ARM A", "INVET - ARM A", "OVRINV - ARM A")
)
value_choices(ADRS, c("PARAMCD", "ARMCD"), c("PARAM", "ARM"), sep = " --- ")
# delayed version
value_choices("ADRS", c("PARAMCD", "ARMCD"), c("PARAM", "ARM"))
# functional subset
value_choices(ADRS, "PARAMCD", "PARAM", subset = function(data) {
levels(data$PARAMCD)[1:2]
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.