data_extract_ui {teal.transform} | R Documentation |
teal
data extraction module user-interface
Description
Usage
data_extract_ui(id, label, data_extract_spec, is_single_dataset = FALSE)
Arguments
id |
( |
label |
( |
data_extract_spec |
( |
is_single_dataset |
( |
Details
There are three inputs that will be rendered
Dataset select Optional. If more than one data_extract_spec is handed over to the function, a shiny shiny::selectInput will be rendered. Else just the name of the dataset is given.
Filter Panel Optional. If the data_extract_spec contains a filter element a shiny shiny::selectInput will be rendered with the options to filter the dataset.
Select panel A shiny shiny::selectInput to select columns from the dataset to go into the analysis.
The output can be analyzed using data_extract_srv(...)
.
This functionality should be used in the encoding panel of your teal
app.
It will allow app-developers to specify a data_extract_spec()
object.
This object should be used to teal
module variables being filtered data
from CDISC datasets.
You can use this function in the same way as any
shiny module
UI.
The corresponding server module can be found in data_extract_srv()
.
Value
Shiny shiny::selectInput
s
that allow to define how to extract data from
a specific dataset. The input elements will be returned inside a shiny::div container.
Examples
library(shiny)
library(teal.widgets)
adtte_filters <- filter_spec(
vars = c("PARAMCD", "CNSR"),
sep = "-",
choices = c("OS-1" = "OS-1", "OS-0" = "OS-0", "PFS-1" = "PFS-1"),
selected = "OS-1",
multiple = FALSE,
label = "Choose endpoint and Censor"
)
response_spec <- data_extract_spec(
dataname = "ADTTE",
filter = adtte_filters,
select = select_spec(
choices = c("AVAL", "BMRKR1", "AGE"),
selected = c("AVAL", "BMRKR1"),
multiple = TRUE,
fixed = FALSE,
label = "Column"
)
)
# Call to use inside your teal module UI function
standard_layout(
output = tableOutput("table"),
encoding = div(
data_extract_ui(
id = "regressor",
label = "Regressor Variable",
data_extract_spec = response_spec
)
)
)