selectVServer: Shiny module server for selecting columns from a data table

View source: R/selectV.R

selectVServerR Documentation

Shiny module server for selecting columns from a data table

Description

Returns the selected columns.

Usage

selectVServer(
  id,
  data = reactive(NULL),
  key = "ID",
  label = HTML("<strong>Phenotype/Experimental variable(s)</strong>"),
  selected = reactive(NULL),
  countby = reactive(NULL),
  maxitems = 3
)

Arguments

id

Character ID for specifying namespace, see shiny::NS.

data

A reactive data.table. See details.

key

A key column that is kept for every selected subset. Defaults to "ID".

label

Label for variable select input.

selected

Optional, initial selection.

countby

A vector of IDs, which are intersected with the key (IDs) in data to generate counts in the select options. See details.

maxitems

Maximum number of items that can be selected. Defaults to 3.

Details

This is a subcomponent intended to serve under multiVCtrlServer but should be generic enough to be integrated with other modules. When data is uploaded through multiVCtrlServer, it can be "high-throughput" or "low-throughput" type data, the latter typically as phenotype or clinical variables. This module handles the latter data type. When the user adds (uploads) new data columns, the selection updates to include these new options. When the user selects specific columns from the menu, a column-subsetted table is returned. The most recent modification added parenthesized counts for each variable option, e.g. "phenotypeX (15)", calculated by intersections with a vector of IDs.

Value

A subsetted data.table.

See Also

Other selectV module functions: selectVUI()


avucoh/DIVE documentation built on Aug. 29, 2023, 6:02 p.m.