matrixApp2Server: Shiny app server for interactive matrix (v2)

View source: R/matrixApp2.R

matrixApp2ServerR Documentation

Shiny app server for interactive matrix (v2)

Description

See matrixCtrl2UI

Usage

matrixApp2Server(
  id,
  M,
  N,
  P,
  cdata,
  metafilter = reactive({ }),
  factorx,
  colorby,
  colorscales = list(default = list(colorscale_named(pal = "RdBu"), zmin = -1, zmax =
    1)),
  informd = system.file("info/interactive_matrix.Rmd", package = "DIVE"),
  appdata = NULL
)

Arguments

id

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

M

A data matrix, e.g. a correlation matrix, which must have row and column names.

N

A matrix of the same dimensions as 'M' to be used as a filter layer, e.g. sample size.

P

A matrix of the same dimensions as 'M' to be used as a filter layer, e.g. p-values.

cdata

The data used for generating the matrix, necessary for allowing user-uploaded data for mutable 'M'.

metafilter

A reactive filter such as from dataHelper, used to filter upon the matrix.

factorx

Optional, a function that returns a boolean for whether a variable should be plotted as factor when given the variable name. Useful when for some reason factor variables are numeric or character instead of already factor-encoded. By default, variables are merely checked using base::is.factor, which works when the data is already factor-encoded.

colorby

A named list where name matches the (factor) variable in cdata to use for color grouping. If there is a named vector, this is passed into scale_color_manual to be used for custom color mapping, e.g. 'list(MyGroupingVar = c(A = "red", B = "blue"))' (useful for enforcing a consistent/meaningful color scheme), or use ‘list(MyGroupingVar = NULL)' if custom color scaling isn’t necessary. See also details.

colorscales

Optional, a list of custom colorscale functions that takes a numeric matrix and returns either a named colorscale or custom colorscale used for heatmap. If not given, two default colorscale functions are used.

informd

Relative path to the Rmarkdown file, whose contents will be displayed in the modal.

appdata

Optional, the path of one or more files that can be mock-uploaded. See details.


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