View source: R/plots-timeProfileIntervalPlot.R
timeProfileIntervalPlot | R Documentation |
Visualize time intervals across subjects/parameters.
timeProfileIntervalPlot( data, paramVar, paramLab = getLabelVar(paramVar, labelVars = labelVars), paramVarSep = " - ", paramGroupVar = NULL, timeStartVar, timeStartLab = getLabelVar(timeStartVar, labelVars = labelVars), timeEndVar, timeEndLab = getLabelVar(timeEndVar, labelVars = labelVars), timeStartShapeVar = NULL, timeStartShapeLab = getLabelVar(timeStartShapeVar, labelVars = labelVars), timeEndShapeVar = NULL, timeEndShapeLab = getLabelVar(timeEndShapeVar, labelVars = labelVars), shapePalette = NULL, colorVar = NULL, colorLab = getLabelVar(colorVar, labelVars = labelVars), colorPalette = NULL, alpha = 1, yLab = NULL, xLab = paste(c(timeStartLab, timeEndLab), collapse = " and "), title = NULL, subtitle = NULL, caption = NULL, labelVars = NULL, width = 800, height = NULL, hoverVars, hoverLab, idVar = "USUBJID", idLab = getLabelVar(idVar, labelVars = labelVars), pathVar = NULL, pathLab = getLabelVar(pathVar, labelVars = labelVars), id = paste0("plotClinData", sample.int(n = 1000, size = 1)), selectVars = NULL, selectLab = getLabelVar(selectVars, labelVars = labelVars), table = FALSE, tableVars, tableLab, tableButton = TRUE, tablePars = list(), verbose = FALSE )
data |
Data.frame with data. |
paramVar |
Character vector with variable of |
paramLab |
(optional) String with label for |
paramVarSep |
(optional) String with separator used to combined |
paramGroupVar |
(optional) Character vector with variable(s) to group/order
the |
timeStartVar |
String with variable with the start of the time interval. |
timeStartLab |
(optional) String with label for |
timeEndVar |
String with variable with the end of the time interval. |
timeEndLab |
(optional) String with label for |
timeStartShapeVar |
(optional) String with variable used for the shape of the start of the time interval. |
timeStartShapeLab |
(optional) String with label for |
timeEndShapeVar |
(optional) String with variable used for the shape of the end of the time interval. |
timeEndShapeLab |
(optional) String with label for |
shapePalette |
(optional) Character vector with shape palette for
|
colorVar |
(optional) String with color variable. |
colorLab |
String with label for |
colorPalette |
(optional) Named character vector with color palette.
If not specified, the viridis color palette is used. |
alpha |
(optional) Numeric with transparency, 1 by default. |
xLab, yLab |
(optional) String with labels for the x/y-axis. |
title |
String with title for the plot. |
subtitle |
String with subtitle. |
caption |
String with caption. |
labelVars |
Named character vector containing variable labels. |
width |
Numeric, width of the plot in pixels, 700 by default. |
height |
Numeric, height of the plot in pixels, 700 by default. |
hoverVars |
Character vector with variable(s) to be displayed in the hover, by default any position and aesthetic variables displayed in the plot. |
hoverLab |
Named character vector with labels for |
idVar |
String with variable containing subject ID. |
idLab |
String with label for |
pathVar |
String with variable of <a href="./path-to-report">label</a> .
|
pathLab |
String with label for |
id |
String with general id for the plot:
If not specified, a random id, as 'plotClinData[X]' is used. |
selectVars |
(optional) Character vector with variable(s) from |
selectLab |
(Named) character vector with label 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
|
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. |
Either:
if a table
is requested:
a clinDataReview
object, a.k.a a list with the
'plot' (plotly
object) and 'table'
(datatable
object)
otherwise: a plotly
object
Laure Cougnaud
Other Clinical data visualization of individual profiles.:
scatterplotClinData()
library(clinUtils) data(dataADaMCDISCP01) labelVars <- attr(dataADaMCDISCP01, "labelVars") dataAE <- dataADaMCDISCP01$ADAE # basic plot timeProfileIntervalPlot( data = dataAE, paramVar = "USUBJID", # time-variables timeStartVar = "ASTDY", timeEndVar = "ASTDY", # colored by severity colorVar = "AESEV", labelVars = labelVars ) # add caption & subtitle timeProfileIntervalPlot( data = dataAE, paramVar = "USUBJID", timeStartVar = "ASTDY", timeEndVar = "ASTDY", colorVar = "AESEV", labelVars = labelVars, title = "Adverse events", subtitle = "Time intervals", caption = "Day is relative to the study baseline" ) # add a selection box if(interactive()){ timeProfileIntervalPlot( data = dataAE, paramVar = "USUBJID", # time-variables timeStartVar = "ASTDY", timeEndVar = "ASTDY", # colored by severity colorVar = "AESEV", labelVars = labelVars, selectVars = "AEDECOD" ) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.