Skip to contents

Run filtering panel locally

Usage

gui(
  cohort,
  steps = TRUE,
  stats = c("pre", "post"),
  run_button = FALSE,
  feedback = TRUE,
  state = TRUE,
  bootstrap = 3,
  enable_bookmarking = TRUE,
  code = TRUE,
  attrition = TRUE,
  show_help = TRUE,
  new_step = c("clone", "configure")
)

Arguments

cohort

Cohort object with configured filters.

steps

Set to TRUE (default) if multiple steps should be available.

stats

Choose which statistics should be displayed for data (and some filters). Possible options are: "pre" - previous step stat, "post" - current step stats, `c("pre", "post")` - for both and NULL for no stats.

run_button

Should Run button be displayed? If so, the current step computations are run only when clicked.

feedback

Set to TRUE (default) if feedback plots should be displayed at each filter.

state

Set to TRUE (default) to enable get/set state panel.

bootstrap

Boostrap version to be used for filtering panel. See bs_theme version argument.

enable_bookmarking

Set to TRUE (default) if panel should be compatible with native shiny bookmarking.

code

Set to TRUE (default) to enable reproducible code panel.

attrition

Set to TRUE (default) to enable attrition plot panel.

show_help

Set to TRUE (default) to enable help buttons.

new_step

Choose which add step method should be used for creating new step. Possible options are: "clone" - copy filters from last step, "configure" - opening modal and allow to chose filters from available filters.

Value

No return value, used for side effect which is running a Shiny application.

Examples

if (interactive()) {
  library(magrittr)
  library(cohortBuilder)
  library(shinyCohortBuilder)
  mtcars_source <- set_source(tblist(mtcars = mtcars))
  mtcars_cohort <- cohort(
    mtcars_source,
    filter("discrete", id = "am", dataset = "mtcars", variable = "am", value = 1)
  ) %>% run()
  gui(mtcars_cohort)
}