formatTimeInterval {patientProfilesVis}R Documentation

Set missing start/end time variable in the data.

Description

Set missing start/end time variable in the data.

Usage

formatTimeInterval(
  data,
  timeStartVar,
  timeStartLab = getLabelVar(timeStartVar, labelVars = labelVars),
  timeEndVar,
  timeEndLab = getLabelVar(timeEndVar, labelVars = labelVars),
  timeStartShapeVar = NULL,
  timeEndShapeVar = NULL,
  subjectVar = "USUBJID",
  timeLim = NULL,
  timeLimData = NULL,
  timeLimStartVar = NULL,
  timeLimStartLab = getLabelVar(timeLimStartVar, labelVars = labelVars),
  timeLimEndVar = NULL,
  timeLimEndLab = getLabelVar(timeLimEndVar, labelVars = labelVars),
  timeImpType = c("minimal", "data-based", "none"),
  labelVars = NULL
)

Arguments

data

Data.frame with data.

timeStartVar

String, variable of data with start of time interval.

timeStartLab

String, label for timeStartVar, displayed in a message and in the plot caption.

timeEndVar

String, variable of data with end of time interval.

timeEndLab

String, label for timeEndVar, displayed in a message and in the plot caption.

timeStartShapeVar

(optional) String, variable of data used for the shape of the symbol displayed at the start of the time interval.
If not specified, default shape palette is used, see section 'Time interval representation'.

timeEndShapeVar

String, variable of data used for the shape of the symbol displayed at the end of the time interval. If not specified, default shape palette is used, see section 'Time interval representation'.

subjectVar

String, variable of data with subject ID

timeLim

(optional) Vector of length 2 with time limits (x-axis). If not specified, these are extracted from the minimum timeStartVar and maximum timeEndVar per subject.
The time limits are stored as attributes of the plots, used to align the plots in the final report.

timeLimData

Data.frame with data used to impute time in case some time records are missing in data, see section: 'Time interval representation'.

timeLimStartVar

String, variable of timeLimData with start of the time interval.

timeLimStartLab

String, label for timeLimeStartVar, displayed in a message and in the plot caption.

timeLimEndVar

String, variable of timeLimData with end of the time interval.

timeLimEndLab

String, label for timeLimEndVar, displayed in a message and in the plot caption.

timeImpType

String with imputation type: 'minimal' (default), 'data-based' or 'none', see section: 'Time interval representation'.
This imputation type is not used if a dataset used to impute time is specified.

labelVars

Named character vector with variable labels (names are the variable code)

Value

list with:

Time interval representation

In case the start or the end of the time interval contain missing values:

The symbols displayed at the start and end of the interval are:

The time limits are the same across subjects, and set to:

Author(s)

Laure Cougnaud


[Package patientProfilesVis version 2.0.7 Index]