formatDTBarVar {clinUtils}R Documentation

Format a variable in a datatable as a barplot.

Description

Format a variable in a datatable as a barplot.

Usage

formatDTBarVar(
  tableDT,
  data,
  barVar = NULL,
  barColorThr = NULL,
  barRange = NULL,
  getCol = function(x) x
)

Arguments

tableDT

datatable object

data

Data.frame with content of tableDT.

barVar

Character vector with numeric variable of data which should be represented as bar in the table.

barColorThr

Numeric vector with threshold to consider to color the bar, either:

  • a numeric vector of length 1, same threshold for all bars

  • named vector with threshold for each bar, named with the variable in barVar

barRange

(optional) range for the bars, either:

  • a numeric vector of length 2, same range for all bars

  • list with range for each bar, named with the variable in barVar

If not specified, the range of each barVar variable in data is used.

getCol

Function, which for an index of a column in data returns the index of the column to be passed to formatStyle

Value

Updated tableDT

Author(s)

Laure Cougnaud


[Package clinUtils version 0.1.4 Index]