By default all subjects available in at least one module of listPlots
are considered.
If only a set of subjects are of interest, these are specified either:
directly with the subject IDs of interest via subjectSubset
by extracting subjects with a specific value (subjectSubsetValue
)
in a variable (subjectSubsetVar
) in a specific dataset subjectSubsetData
createSubjectProfileReport(
listPlots,
timeLim = NULL,
timeAlign = "all",
timeAlignPerSubject = "none",
refLines = NULL,
refLinesData = NULL,
refLinesTimeVar = NULL,
refLinesLabelVar = NULL,
bookmarkData = NULL,
bookmarkVar = NULL,
subjectSortData = bookmarkData,
subjectSortVar = bookmarkVar,
subjectSortDecreasing = FALSE,
subjectVar = "USUBJID",
subjectSubset = NULL,
subjectSubsetData = NULL,
subjectSubsetVar = NULL,
subjectSubsetValue = NULL,
subjectSample = NULL,
seed = 123,
subset = NULL,
outputFile = "subjectProfile.pdf",
exportFigures = FALSE,
reportPerSubject = FALSE,
exportBatchSize = NULL,
labelVars = NULL,
maxNLines = NULL,
shiny = FALSE,
formatReport = subjectProfileReportFormat(),
verbose = FALSE,
nCores = 1
)
The path(s) of the report(s) is returned invisibly, and the
report is created at the location
specified by outputFile
.
If the report is created by subject,
the name of the exported subject profile is built as:
[filename]-[subjectID].pdf
, with [filename] extracted from
outputFile
.
Space and platform-specific file separator are replaced by
a dash in the filename.
If no patient profiles are available in the input, nothing is returned and a warning is triggered.
nested list of plots, as returned by the subjectProfileTextPlot
,
subjectProfileEventPlot
, subjectProfileIntervalPlot
or
subjectProfileLinePlot
functions.
Time limits, as a numeric vector of length 2,
or a list with time limits for each module,
or nested list with time limits for each module and subject.
If not specified, these are set to the time limits specified
when creating each module (stored in attributes(x)$metaData$timeLim
)
otherwise to the range defined by timeAlign
and timeAlignPerSubject
.
Note that this doesn't modify the geoms of the plots, it only extends the
axis range. So for interval module(s) if the specified timeLim
is smaller than the time limits in the input plot, no arrows are created in case than
the time goes above/below specified timeLim
(the segment is cut).
Character vector with time alignment across modules/subjects, either:
'all' (by default): all plots have the same time limits
'none': each of the plot (module*subject) has its own time limits
character vector with names of the modules which
should have the same time limits
(should correspond to the names of listPlots
)
Character vector, specifying if the plots should be aligned (or not) across subjects
'none' (by default): all modules to align have the same time limit across subjects
'all': all modules to align have different time limits per subject
character vector with subset of the modules to align per subject
(should correspond to the names of listPlots
)
Only the modules already specified in timeAlign
can be aligned by subject.
(optional) nested list with details for reference line(s). Each sublist contains:
(required) 'label': string with label for the reference line
(required) 'time': unique time (x) coordinate for the reference line
(optional) 'color': color for the reference line, 'black' by default
(optional) 'linetype': linetype for the reference line, 'dotted' by default
data.frame with data from which the reference line(s) should be extracted
string, variable of refLinesData
with time for reference line(s)
string, variable of refLinesData
with label for reference line(s)
Data.frame with data containing information for the index,
and character vector with corresponding variable(s) of interest.
An index will be created at the end of the subject profile report.
The index contains a section per variable, referencing the
pages of the report containing subject profiles
for each category/variable.
Data.frame with data containing information on how the subjects
should be sorted (by default same as bookmarkData
):
in the report, in case one single report is created for all subjects
for the export, in case reportPerSubject
is TRUE
This data should contain subjectSortVar
and subjectVar
.
Character vector,
variable(s) of subjectSortData
indicating the order for the subjects in the report,
(by default same as bookmarkVar
).
Logical, if TRUE (FALSE by default)
subjects are sorted based on decreasing order of subjectSortVar
.
String, variable of data
with subject ID
subjectSubset (optional) Character vector with subjects of interest
(available in subjectVar
), NULL by default.
Data.frame used to select subset of subjects of interest.
String with variable of subjectSubsetData
that should be considered to filter subjects.
If not specified, all subjects available in subjectSubsetData
are considered.
Character vector with value(s) of subjectSubsetVar
of interest to filter subjects on.
(optional) Integer of length 1 with number of random subject(s) that should be considered in the specified subset dataset. By default, all specified subjects are considered (set to NULL).
(optional) Integer of length 1 with seed used to select random subjects
if subjectSample
is specified (123 by default).
Character vector with subjects of interest
(among names of each list in listPlots
).
string, path to the output report
Logical, if TRUE (FALSE by default) the
subject profile figures are also exported
in pdf format in a 'figures' folder.
Figures are named as [subjectID]-[page].pdf
Logical, if TRUE (FALSE by default) export a subject profile report by subject.
(optional) Integer, if specified, the
patient-profile reports are created by batch of this number of subjects.
This might speed up the export for a high number of subjects.
Only available if report is created by subject (reportPerSubject
is TRUE)
and modules are not aligned across subjects (timeAlignPerSubject
is: 'all').
Named character vector with variable labels (names are the variable code)
Maximum number of lines for a combined plot,
to fit in the page height.
When the different visualizations
are combined for each subject, they will be allocated
to different pages if the number of lines of the combined visualization
is higher than this number.
logical, set to TRUE (FALSE by default)
if the report is generated from a Shiny application.
Messages during report creation will be included in the Shiny interface,
and it will be mentioned at the end of the report.
In this case, the shiny
package should be available.
list with parameters used to specify the format of the report,
e.g. output of the subjectProfileReportFormat
function
logical, if TRUE print messages during execution
Integer containing the number of cores used for the computation
(1 by default). If more than 1, computation is parallelized, in this case
the package parallel
is required.
Laure Cougnaud