Skip to contents

Server for the Tplyr_table module

Usage

Tplyr_table_server(
  module_id,
  dataset_list,
  output_list,
  dataset_metadata,
  subjid_var,
  default_vars,
  intended_use_label,
  pagination = NULL,
  listing_pagination = NULL,
  table_pagination = TRUE,
  on_sbj_click = NULL,
  review = NULL,
  title_layout = c("dropdown", "tabs"),
  footers = NULL,
  exclude_var_names_from_column_headings = FALSE
)

Arguments

module_id

[character(1)] A character string that serves as a unique identifier for the module.

dataset_list

[shiny::reactive(list(data.frame))] A reactive list of data.frame-like dataset(s) that will be used to create the table and the listing(s).

output_list

[list(list())] A named list defining the outputs to be generated. Each element of the list corresponds to a table or listing and must be a named list with one of the following structures:

For summary tables:

tplyr_tab_fun

A function that takes one or more datasets as input and returns a tplyr_table object.

build_fun

A function that takes the tplyr_table object and returns a built table (typically using Tplyr::build()). The metadata argument of Tplyr::build() needs to be set to TRUE, so that the corresponding listing can be shown.

For listings:

dataset_names

A character vector of dataset names required to generate the listing.

The names of the top-level list elements are used as identifiers for the outputs.

dataset_metadata

[list(character(1), character(1+))] A list with the following two elements: dataset_metadata$name() containing a reactive string specifying the name of the selected dataset and dataset_metadata$date_range() containing a reactive character vector with two entries specifying the earliest and latest modification date in the dataset. Usually obtained from the module manager.

subjid_var

[character(1) | NULL] Column corresponding to participant ID. Default value is 'USUBJID'.

default_vars

An argument of listings_server of {dv.listings} will be passed through.

intended_use_label

An argument of listings_server of {dv.listings} will be passed through.

pagination

Deprecated. Legacy alias for listing_pagination. This argument currently controls pagination for drill-down and standalone listings generated by dv.listings. It is retained for backward compatibility but will be removed in a future version. Please use listing_pagination instead.

listing_pagination

Pagination configuration for the drill-down and standalone listings generated by dv.listings. This is passed through to dv.listings::listings_server().

table_pagination

[logical(1) | integer(1)] Pagination behavior for the rendered Tplyr summary table. If TRUE, table pagination is enabled using the default page size from reactable. If FALSE, table pagination is disabled. If a positive whole number is supplied, table pagination is enabled and the number is used as defaultPageSize in reactable::reactable(). Defaults to TRUE.

on_sbj_click

An argument of listings_server of {dv.listings} will be passed through.

review

An argument of listings_server of {dv.listings} will be passed through.

title_layout

[character(1)] A character string defining how users can select the outputs in output_list. Supported values are:

"dropdown" (default)

Renders the current interactive title with a drop-down selector.

"tabs"

Renders a horizontal tabsetPanel with one tab per entry in output_list. Tabs will wrap to the next line if there are many. The rest of the module behavior is unchanged.

footers

An argument of listings_server of {dv.listings} will be passed through.

exclude_var_names_from_column_headings

An argument of listings_server of {dv.listings} will be passed through.