Learn R Programming

shinyCohortBuilder (version 0.4.0)

autofilter: Generate filters definition based on the Source data

Description

The method should analyze source data structure, generate proper filters based on the data (e.g. column types) and attach them to source.

Usage

autofilter(source, attach_as = c("step", "meta"), ...)

# S3 method for default autofilter(source, ...)

# S3 method for tblist autofilter(source, attach_as = c("step", "meta"), ...)

Value

Source object having step configuration attached.

Arguments

source

Source object.

attach_as

Choose whether the filters should be attached as a new step, or list of available filters (used in filtering panel when `new_step = "configure"`). By default in step.

...

Extra arguments passed to a specific method.

See Also

source-gui-layer

Examples

Run this code
library(magrittr)
library(cohortBuilder)
library(shinyCohortBuilder)

iris_source <- set_source(tblist(iris = iris)) %>%
  autofilter()
iris_cohort <- cohort(iris_source)
sum_up(iris_cohort)

if (interactive()) {
  library(shiny)

  ui <- fluidPage(
    cb_ui("mycoh")
  )

  server <- function(input, output, session) {
    cb_server("mycoh", cohort = iris_cohort)
  }

  shinyApp(ui, server)
}

Run the code above in your browser using DataLab