library(shiny)
library(teal.data)
ADSL <- teal.transform::rADSL
ADTTE <- teal.transform::rADTTE
choices1 <- choices_labeled(names(ADSL), col_labels(ADSL, fill = FALSE))
choices2 <- choices_labeled(ADTTE$PARAMCD, ADTTE$PARAM)
# if only a subset of variables are needed, use subset argument
choices3 <- choices_labeled(
names(ADSL),
col_labels(ADSL, fill = FALSE),
subset = c("ARMCD", "ARM")
)
ui <- fluidPage(
selectInput("c1",
label = "Choices from ADSL",
choices = choices1,
selected = choices1[1]
),
selectInput("c2",
label = "Choices from ADTTE",
choices = choices2,
selected = choices2[1]
),
selectInput("c3",
label = "Arm choices from ADSL",
choices = choices3,
selected = choices3[1]
)
)
server <- function(input, output) {}
if (interactive()) {
shinyApp(ui, server)
}
Run the code above in your browser using DataLab