Scatterplot of variables of interest for clinical data visualization
staticScatterplotClinData(
data,
xVar,
yVar,
xLab = getLabelVar(xVar, labelVars = labelVars),
yLab = getLabelVar(yVar, labelVars = labelVars),
aesPointVar = list(),
pointPars = list(),
aesLineVar = list(),
linePars = list(),
lineInclude = length(c(aesLineVar, linePars)) > 0,
aesSmoothVar = list(),
smoothPars = list(),
smoothInclude = length(c(aesSmoothVar, smoothPars)) > 0,
aesLab,
xTrans = "identity",
yTrans = "identity",
xPars = list(),
yPars = list(),
xLabVars = NULL,
yLim = NULL,
xLim = NULL,
yLimExpandData = TRUE,
xLimExpandData = TRUE,
title = paste(c(paste(yLab, "vs", xLab), titleExtra), collapse = "
"),
titleExtra = NULL,
facetPars = list(),
facetType = c("wrap", "grid"),
scalePars = list(),
themePars = list(legend.position = "bottom"),
refLinePars = NULL,
labelVars = NULL,
hoverVars = NULL,
geomType = c("point", "col")
)
ggplot
object
Data.frame with input data.
String with column of data
containing x-variable.
String with column of data
containing y-variable.
String with label for xVar
.
String with label for xVar
.
List with specification of aesthetic variable(s),
for the point, passed to the mapping
parameter of geom_point
,
e.g. list(color = "TRTP")
.
Please note by default symbols with fill and color are used.
Color is used for the outside of the points, fill for the inside
and the hover. Usually, you might want to specify both
filling and coloring.
List with parameters other than aesthetic variables to pass to geom_point
,
defaults to empty list.
List with specification of aesthetic variable(s),
for the line, passed to the mapping
parameter of geom_line
,
e.g. list(group = "USUBJID")
.
List with parameters other than aesthetic variables to pass to geom_line
,
defaults to empty list.
Logical, if TRUE (by default if aesLineVar
is specified)
include a scatterplot.
List with specification of aesthetic variable(s),
for the smoothing layer, passed to the mapping
parameter of geom_smooth
defaults to empty list.
List with parameters other than aesthetic variables to pass to geom_smooth
,
defaults to empty list. Note this parameter overwrites other parameters set by aesSmoothVar
.
Logical, if TRUE (by default if one of aesSmoothVar or smoothPars
is non-empty)
Named character vector with labels for each aesthetic variable.
Transformation for the x/y- variables,
passed to the trans
parameter of scale_x_continuous
/
scale_y_continuous
.
List with extra parameters for x/y axis, passed to the
scale_x_continuous
/
scale_y_continuous
functions,
besides trans
and limits
.
Character vector with variable(s) to be displayed
as the labels of the ticks in the x-axis.
By default, xVar
is displayed.
If specified, this overwrites any labels
specified via xPars
.
In case the variable(s) contain different elements
by xVar
or between facets, they are combined
and displayed below each other.
Numeric vector of length 2 with limits for the x/y axes.
Logical (TRUE by default), should the
limits specified via xLim
/yLim
be
expanded to include any data points outside of these
limits?
Please note that the same limits are set for all facets.
String with title for the plot.
String with extra title for the plot (appended after title
).
List with facetting parameters, passed to the facetting function.
String with facetting type, either:
'wrap': facet_wrap
'grid': facet_grid
List with parameters to customize
scales. Each sublist should contains a set of parameters
passed to the scale_discrete_manual
function.
If palette(s) are not specified, default palettes are used
(see getColorPalette,
getShapePalette,
getLinetypePalette
)
List with general theme parameters
(see theme
).
(optional) Nested list, with parameters for each reference line(s). Each sublist (a.k.a reference line) contains:
aesthetic value(s) or variable(s) for the lines
(in this case column names of data
) for reference lines.
The line position is controlled by the aesthetics supported in
geom_vline
, geom_hline
and geom_abline
.
'label': (optional) Logical specifying if the line
should be annotated (FALSE
to not annotate the line)
or string with annotation label. By default, the value
of the position of the horizontal/vertical line or the equation
of the diagonal line is displayed.
Named character vector containing variable labels.
Character vector with variables to be displayed in the hover,
by default xVar
, yVar
and any aesthetic variables.
String with type of the geom used, either:
'point': scatterplot with geom_point
is created
'col': barplot with geom_col
is created
Laure Cougnaud, Adriaan Blommaert