Skip to contents

The shiny_vector_filter family of S3 dispatched functions use the input data to route to the appropriate ui and server functions for the vector datatype.

Usage

shiny_vector_filter(data, inputId, global = FALSE)

Arguments

data

the data object to be filtered

inputId

The input slot that will be used to access the value.

global

A logical value indicating whether the call is issued through global methods search. Typically does not need to be specified unless explicitly trying to avoid a global search for methods.

Value

a shiny server function as described in the details

Details

The shiny_vector_filter functions return the shiny module server functions to use for the specified filter. These functions should follow the following template:


  function(input, output, session, x, filter_na, verbose = FALSE) {
    # ... additional code here
    reactiveValues(code = TRUE, mask = TRUE)
  }

This function will conform to the following specification

Arguments

input

requisite shiny module field specifying incoming ui input reactiveValues

output

requisite shiny module field capturing output for the shiny data filter ui

session

requisite shiny module field containing the active shiny session

x

a reactive expression resolving to the vector to filter

filter_na

a logical value indicating whether to filter NA values from the x vector

verbose

a logical value indicating whether or not to print log statements out to the console

Value a reactiveValues list containing a logical vector called "mask" which can be used to filter the provided vector and an element "code" which is the expression used to generate the mask.