subjectProfileIntervalPlot {patientProfilesVis} | R Documentation |
Visualize time interval in subject profiles, so event with a start and end time.
Description
Visualize time interval in subject profiles, so event with a start and end time.
Usage
subjectProfileIntervalPlot(
data,
paramVar,
paramVarSep = " - ",
paramLab = getLabelVar(paramVar, labelVars = labelVars),
paramGroupVar = NULL,
timeStartVar,
timeStartLab = getLabelVar(timeStartVar, labelVars = labelVars),
timeEndVar,
timeEndLab = getLabelVar(timeEndVar, labelVars = labelVars),
timeLab = toString(c(timeStartLab, timeEndLab)),
subjectVar = "USUBJID",
subjectSubset = NULL,
subjectSample = NULL,
seed = 123,
subsetData = NULL,
subsetVar = NULL,
subsetValue = NULL,
timeImpType = c("minimal", "data-based", "none"),
timeLim = NULL,
timeLimData = NULL,
timeLimStartVar = NULL,
timeLimStartLab = getLabelVar(timeLimStartVar, labelVars = labelVars),
timeLimEndVar = NULL,
timeLimEndLab = getLabelVar(timeLimEndVar, labelVars = labelVars),
timeTrans = NULL,
timeExpand = NULL,
timeAlign = TRUE,
xLab = timeLab,
yLab = "",
colorVar = NULL,
colorLab = getLabelVar(colorVar, labelVars = labelVars),
colorPalette = NULL,
alpha = 1,
timeStartShapeVar = NULL,
timeEndShapeVar = NULL,
shapePalette = NULL,
shapeLab = toString(unique(getLabelVar(c(timeStartShapeVar, timeEndShapeVar), labelVars
= labelVars))),
shapeSize = rel(3),
title = toString(getLabelVar(paramVar, labelVars = labelVars, label = paramLab)),
label = title,
caption,
labelVars = NULL,
formatReport = subjectProfileReportFormat(),
paging = TRUE
)
Arguments
data |
Data.frame with data. |
paramVar |
Character vector with variable(s) of |
paramVarSep |
string with character(s) used to concatenate multiple
|
paramLab |
Named character vector,
with label for the parameter variable(s) ( |
paramGroupVar |
(optional) Character vector with variable(s)
of |
timeStartVar |
String, variable of |
timeStartLab |
String, label for |
timeEndVar |
String, variable of |
timeEndLab |
String, label for |
timeLab |
String, label for |
subjectVar |
String, variable of |
subjectSubset |
(optional) Character vector with subjects of interest
(available in |
subjectSample |
(optional) Integer of length 1 with number of random subject(s) that should be considered, e.g. to check the created patient profiles for a subset of the data. By default, all specified subjects are considered (set to NULL). |
seed |
(optional) Integer of length 1 with seed used to select random subjects
if |
subsetData |
(optional) Data.frame with extra dataset to filter on.
This dataset is filtered, and only records from |
subsetVar |
(optional) String with variable of subset data to filter on.
|
subsetValue |
(optional) Character vector with value(s) of interest to
retain in the filtered data.
These values should be available in |
timeImpType |
String with imputation type: 'minimal' (default),
'data-based' or 'none', see section: 'Time interval representation'. |
timeLim |
(optional) Vector of length 2 with time limits (x-axis).
If not specified, these are extracted from the minimum |
timeLimData |
Data.frame with data used to impute time
in case some time records are missing in |
timeLimStartVar |
String, variable of |
timeLimStartLab |
String, label for |
timeLimEndVar |
String, variable of |
timeLimEndLab |
String, label for |
timeTrans |
transformation for the time variable,
(see |
timeExpand |
Vector of range expansion constants for the time axis
(see |
timeAlign |
Logical, if TRUE (by default)
the different plots are horizontally aligned.
If set to FALSE, each plot has its own time-limits. |
xLab |
String, label for the x-axis. |
yLab |
String, label for the y-axis. |
colorVar |
String, variable of |
colorLab |
String, label for |
colorPalette |
Named vector with color palette.
The variable should be named with the corresponding element
in
|
alpha |
Numeric with transparency, 1 by default. |
timeStartShapeVar |
(optional) String, variable of |
timeEndShapeVar |
String, variable of |
shapePalette |
Named vector with (combined) shape palette for
|
shapeLab |
String with label for |
shapeSize |
Size for symbols (only used if |
title |
String with title, label of the parameter variable by default. |
label |
String, label for the visualization.
This label is stored as attributes of the output
from the |
caption |
(optional) String with caption (NULL for no caption). By default the caption contains information on the imputation strategy for missing time. |
labelVars |
Named character vector with variable labels (names are the variable code) |
formatReport |
list with parameters used to specify the format of the report,
e.g. output of the |
paging |
Logical, if TRUE (by default), automatic
paging is enabled, so patient profiles module too big to fit
in one page will span multiple pages.
Please note that the size of the graphic window
(or report page) may need
to be re-sized in order that the plot fits.
|
Value
list of (across subjects) of list (across pages)
of ggplot2 objects
,
also of class subjectProfileIntervalPlot
.
with additional 'metaData' attributes containing
'label
', 'timeLim' timeTrans
and timeExpand
(if specified).
Time interval representation
In case the start or the end of the time interval contain missing values:
if a dataset (
timeLimData
), start (timeLimStartVar
) and end (timeLimEndVar
) variables are specified:for each subject:
the minimum and maximum time values across these specified time variables are extracted
missing start values are replaced by the minimum time
missing start values are replaced by the maximum time
if all values are missing for this subject, they are taken across subjects
otherwise, depending on the imputation type (
timeImpType
):'minimal' (by default):
if the start and the end of the interval are missing: no imputation is done, only the label is displayed
if the start time is missing and the end time is not missing: start time is imputed with end time, and status is set to 'Missing start'
if the end time is missing and the start time is not missing: end time is imputed with start time, and status is set to 'Missing end'
'data-based' (default in version < 1.0.0): minimum/maximum values in the start/end time variables in the data are considered for the specific subject (if available). If there are missing for a specific subject, they are taken across subjects. If all time are missings, the range is set to 0 and Inf
'none': no imputation is done
The symbols displayed at the start and end of the interval are:
by default:
a filled square labelled 'Complete' if the time is not missing
a filled left-directed arrow in case of missing start time
a filled right-directed arrow in case of missing end time
if the variable(s) used for the shape of the start or end of the interval are specified (via
timeStartShapeVar
/timeEndShapeVar
): labels are based on these variables, and a standard shape palette is used
The time limits are the same across subjects, and set to:
timeLim
if specifiedmaximum time range in
timeLimStartVar
andtimeLimEndVar
intimeLimData
if specifiedthe maximum range on the data obtained after imputation of missing values
Author(s)
Laure Cougnaud
See Also
Other patient profiles plotting function:
subjectProfileEventPlot()
,
subjectProfileLinePlot()
,
subjectProfileTextPlot()