subjectProfileSummaryPlot {inTextSummaryTable} | R Documentation |
Plot subject summary profile.
Description
The user can either specify a variable for the standard error
(seVar
),
or directly the variables for the minimum and maximum values for the error
bars (minVar
, maxVar
).
Usage
subjectProfileSummaryPlot(
data,
xVar = NULL,
xLab = getLabelVar(xVar, labelVars = labelVars),
xAxisExpand = waiver(),
xGap = NULL,
xGapDiffNew = NULL,
meanVar = "statMean",
seVar = if ("statSE" %in% colnames(data)) "statSE",
minVar = NULL,
maxVar = NULL,
yLab = paste(c(sub("^stat", "", meanVar), if (!is.null(minVar) & !is.null(maxVar)) {
paste0("(", sub("^stat", "", minVar), ", ", sub("^stat", "", maxVar), ")")
} else
if (!is.null(seVar)) paste("+-", sub("^stat", "", seVar))), collapse = " "),
facetVar = NULL,
facetScale = "free_y",
colorVar = NULL,
colorLab = getLabelVar(colorVar, labelVars = labelVars),
colorPalette = NULL,
labelVars = NULL,
useLinetype = TRUE,
linetypePalette = NULL,
useShape = TRUE,
shapePalette = NULL,
jitter = NULL,
title = NULL,
caption = NULL,
yTrans = NULL,
yLim = NULL,
xLim = NULL,
yAxisExpand = c(0.05, 0.05),
yLimExpand = NULL,
xAxisLabs = NULL,
sizePoint = GeomPoint$default_aes$size,
sizeLine = GeomLine$default_aes$size,
sizeLabel = GeomText$default_aes$size,
widthErrorBar = GeomErrorbar$default_aes$width,
tableText = NULL,
tableTextFontface = 1,
tableHeight = 0.1,
tableYAxisLabs = !is.null(colorVar),
tablePlotMargin = unit(0, "pt"),
label = FALSE,
labelPadding = unit(1, "lines"),
byVar = NULL,
hLine = NULL,
hLineColor = "black",
hLineLty = "solid",
vLine = NULL,
vLineColor = "black",
vLineLty = "solid",
style = "report",
fontname = switch(style, report = "Times", presentation = "Tahoma"),
fontsize = switch(style, report = 8, presentation = 10),
themeFct = switch(style, report = theme_classic, presentation = theme_bw),
themeIncludeVerticalGrid = TRUE,
ggExtra = NULL,
legendPosition = ifelse(!is.null(tableText), "none", "bottom"),
...
)
Arguments
data |
Data.frame with summary statistics to represent in the plot,
e.g. a |
xVar |
String, variable of |
xLab |
String with label for the |
xAxisExpand |
Object passed to the 'expand' parameter of:
|
xGap |
(optional) Numeric vector of length 2 for which
a gap should be created in the x-axis.
Only available if |
xGapDiffNew |
Numeric vector of length 2 with new range
of the |
meanVar |
String, variable of |
seVar |
String, variable of |
minVar , maxVar |
String, variables of |
yLab |
String with label for the y-axis.
If different labels should be used for different elements of
|
facetVar |
Character vector, variable(s) of |
facetScale |
String with type of scale used for facetting, 'free_y' by default (fixed scale in the x-axis and free in the y-axis). |
colorVar |
String, variable of |
colorLab |
String, label for |
colorPalette |
(named) Vector with color palette. |
labelVars |
Named string with variable labels (names are the variable code). |
useLinetype |
Logical, if TRUE (FALSE by default) use also linetype
to differenciate the variable specified via |
linetypePalette |
Vector with linetype(s), in case |
useShape |
Logical, if TRUE (by default) |
shapePalette |
Named vector with shape palette for |
jitter |
Numeric with jitter for the x-axis, only used if |
title |
String with title for the plot.
If different labels should be used for different elements of
|
caption |
String with caption for the plot, NULL by default. |
yTrans |
(optional) String with transformation for the y-axis.
Currently only 'log10' (or NULL, default) is available.
In case error bars go in the negative, their values are set to a 'small enough' value for plotting:
|
yLim |
Vector of the length 2 with limits for the y-axis. |
xLim |
Vector of the length 2 with limits for the x-axis. |
yAxisExpand |
Expansion constants for the limits for the y-axis.
See the documentation of the |
yLimExpand |
This parameter is deprecated, use |
xAxisLabs |
(optional) Named character vector with labels for the x-axis. |
sizePoint |
Size for the point. |
sizeLine |
Size for the line linking means and error bars. |
sizeLabel |
Size for the label, only used if |
widthErrorBar |
Numeric vector of length 1 with width of error bar. |
tableText |
(optional) Character vector with colname of |
tableTextFontface |
Font face for the text included in the table. |
tableHeight |
Numeric of length 1 with height for the table. |
tableYAxisLabs |
Logical, if TRUE (by default)
the labels of the |
tablePlotMargin |
Margin between the plot and the table,
expressed as |
label |
Logical or expression or list of expression.
Points are labelled with |
labelPadding |
Amount of padding (space) between each point
and its |
byVar |
Variable(s) of |
hLine |
(optional) numeric with y-intercept of line(s) to be added.
If different thresholds should be used for different elements of the
|
hLineColor |
String with color for |
hLineLty |
String with linetype for |
vLine |
(optional) numeric with x-intercept of line(s) to be added.
If different thresholds should be used for different elements of the
|
vLineColor |
String with color for |
vLineLty |
String with linetype for |
style |
String with subject profile style.
This affects the parameters: |
fontname |
String with font name,
by default 'Times' if |
fontsize |
Numeric vector of length 1 with font size,
by default 8 if |
themeFct |
Function with ggplot2 theme,
by default |
themeIncludeVerticalGrid |
Logical, if TRUE (by default)
include theme vertical grid lines (if present in |
ggExtra |
Extra |
legendPosition |
String with legend position.
By default, 'bottom' of |
... |
Additional parameters for |
Value
ggplot
object or list of such
objects of byVar
is specified.
Author(s)
Laure Cougnaud