plotCountClinData {clinDataReview}R Documentation

Interactive plot of 'count' data

Description

Note: the table and plot are not (yet) linked.

Usage

plotCountClinData(
  data,
  vars,
  varsLab = getLabelVar(vars, labelVars = labelVars),
  valueVar,
  valueLab = getLabelVar(valueVar, labelVars = labelVars),
  colorVar = NULL,
  colorLab = getLabelVar(valueVar, labelVars = labelVars),
  colorPalette = getOption("clinDataReview.colors"),
  colorRange = NULL,
  valueType = "total",
  title = paste(c(paste(valueLab, "by", paste(varsLab, collapse = " and ")), titleExtra),
    collapse = "<br>"),
  titleExtra = NULL,
  subtitle = NULL,
  caption = NULL,
  labelVars = NULL,
  width = NULL,
  height = NULL,
  pathVar = NULL,
  pathLab = getLabelVar(pathVar, labelVars = labelVars),
  hoverVars = c(vars, valueVar, colorVar),
  hoverLab = getLabelVar(hoverVars, labelVars = labelVars),
  table = FALSE,
  tableVars,
  tableLab,
  tableButton = TRUE,
  tablePars = list(),
  id = paste0("plotClinData", sample.int(n = 1000, size = 1)),
  verbose = FALSE,
  typePlot = c("sunburst", "treemap"),
  watermark = NULL
)

Arguments

data

Data.frame with data.

vars

Character vector with variables of data containing the groups. If multiple, they should be specified in hierarchical order (from parent to child node).

varsLab

Named character vector with labels for vars.

valueVar

String with numeric variable of data containing the value to display.

valueLab

String with label for the valueVar variable.

colorVar

(optional) String with coloring variable (NULL by default). By default, the treemap is colored based by section.

colorLab

String with label for colorVar.

colorPalette

(optional) Named character vector with color palette. If not specified, the viridis color palette is used.
See clinColors.

colorRange

(optional) Numeric vector of length 2 with range for the color variable, in case it is a numeric variable.

valueType

String with type of values in valueVar (branchvalues of the plot_ly) function), among others: 'total' (default, only if sum(child) <= to parent) or 'relative'.

title

String with title for the plot.

titleExtra

String with extra title for the plot (appended after title).

subtitle

String with subtitle.
The subtitle is included at the top left of the plot, below the title.

caption

String with caption.
The caption is included at the bottom right of the plot. Please note that this might overlap with vertical or rotated x-axis labels.

labelVars

Named character vector containing variable labels.

width

Numeric, width of the plot in pixels, 800 by default.

height

Numeric, height of the plot in pixels, 500 by default.

pathVar

String with variable of data containing hyperlinks with path to the subject-specific report, formatted as:

<a href="./path-to-report">label</a>

.
If multiple, they should be separated by: ', '.
The report(s) will be:

  • compressed to a zip file and downloaded if the user clicks on the 'p' (a.k.a 'profile') key when hovering on a point of the plot

  • included in a collapsible row, and clickable with hyperlinks in the table

pathLab

String with label for pathVar, included in the collapsible row in the table.

hoverVars

Character vector with variable(s) to be displayed in the hover, by default any position (and axis) and aesthetic variables displayed in the plot.

hoverLab

Named character vector with labels for hoverVars.

table

Logical, if TRUE (FALSE by default) returns also a datatable containing the plot data. (The plot and the table are not linked.)

tableVars

Character vector with variables to be included in the table.

tableLab

Named character vector with labels for each tableVars.

tableButton

Logical, if TRUE (by default) the table is included within an HTML button.

tablePars

List with parameters passed to the getClinDT function.

id

String with general id for the plot:

  • 'id' is used as group for the SharedData

  • 'button:[id]' is used as button ID if table is TRUE

If not specified, a random id, as 'plotClinData[X]' is used.

verbose

Logical, if TRUE (FALSE by default) progress messages are printed in the current console. For the visualizations, progress messages during download of subject-specific report are displayed in the browser console.

typePlot

String with plot type, 'treemap' or 'sunburst'.

watermark

(optional) String with path to a file containing a watermark.

Value

Either:

Author(s)

Laure Cougnaud

See Also

Other visualizations of summary statistics for clinical data: barplotClinData(), boxplotClinData(), errorbarClinData(), sunburstClinData(), treemapClinData()


[Package clinDataReview version 1.6.1 Index]