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 |
varsLab |
Named character vector with labels for |
valueVar |
String with numeric variable of |
valueLab |
String with label for the |
colorVar |
(optional) String with coloring variable (NULL by default). By default, the treemap is colored based by section. |
colorLab |
String with label for |
colorPalette |
(optional) Named character vector with color palette.
If not specified, the viridis color palette is used. |
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 |
title |
String with title for the plot. |
titleExtra |
String with extra title for the plot (appended after |
subtitle |
String with subtitle. |
caption |
String with caption. |
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 <a href="./path-to-report">label</a> .
|
pathLab |
String with label for |
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 |
table |
Logical, if TRUE (FALSE by default)
returns also a |
tableVars |
Character vector with variables to be included in the table. |
tableLab |
Named character vector with labels
for each |
tableButton |
Logical, if TRUE (by default) the table is included within an HTML button. |
tablePars |
List with parameters passed to the
|
id |
String with general id for the plot:
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:
if a
table
is requested: aclinDataReview
object, a.k.a a list with the 'plot' (plotly
object) and 'table' (datatable
object)otherwise: a
plotly
object
Author(s)
Laure Cougnaud
See Also
Other visualizations of summary statistics for clinical data:
barplotClinData()
,
boxplotClinData()
,
errorbarClinData()
,
sunburstClinData()
,
treemapClinData()