staticScatterplotClinData: Scatterplot of variables of interest for clinical data...

View source: R/plots-staticScatterplotClinData.R

staticScatterplotClinDataR Documentation

Scatterplot of variables of interest for clinical data visualization

Description

Scatterplot of variables of interest for clinical data visualization

Usage

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,
  titleExtra = NULL,
  title = paste(paste(yLab, "vs", xLab, titleExtra), collapse = "<br>"),
  facetPars = list(),
  facetType = c("wrap", "grid"),
  scalePars = list(),
  themePars = list(legend.position = "bottom"),
  refLinePars = NULL,
  labelVars = NULL,
  hoverVars = NULL,
  geomType = c("point", "col")
)

Arguments

data

Data.frame with input data.

xVar

String with column of data containing x-variable.

yVar

String with column of data containing y-variable.

xLab

String with label for xVar.

yLab

String with label for xVar.

aesPointVar

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.

pointPars

List with parameters other than aesthetic variables to pass to geom_point, defaults to empty list.

aesLineVar

List with specification of aesthetic variable(s), for the line, passed to the mapping parameter of geom_line, e.g. list(group = "USUBJID").

linePars

List with parameters other than aesthetic variables to pass to geom_line, defaults to empty list.

lineInclude

Logical, if TRUE (by default if aesLineVar is specified) include a scatterplot.

aesSmoothVar

List with specification of aesthetic variable(s), for the smoothing layer, passed to the mapping parameter of geom_smooth defaults to empty list.

smoothPars

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.

smoothInclude

Logical, if TRUE (by default if one of aesSmoothVar or smoothPars is non-empty)

aesLab

Named character vector with labels for each aesthetic variable.

xTrans, yTrans

Transformation for the x/y- variables, passed to the trans parameter of scale_x_continuous/ scale_y_continuous.

xPars, yPars

List with extra parameters for x/y axis, passed to the scale_x_continuous/ scale_y_continuous functions, besides trans and limits.

xLabVars

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.

xLim, yLim

Numeric vector of length 2 with limits for the x/y axes.

xLimExpandData, yLimExpandData

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.

titleExtra

String with extra title for the plot (appended after title).

title

String with title for the plot.

facetPars

List with facetting parameters, passed to the facetting function.

facetType

String with facetting type, either:

  • 'wrap': facet_wrap

  • 'grid': facet_grid

scalePars

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 )

themePars

List with general theme parameters (see theme).

refLinePars

(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.

labelVars

Named character vector containing variable labels.

hoverVars

Character vector with variables to be displayed in the hover, by default xVar, yVar and any aesthetic variables.

geomType

String with type of the geom used, either:

  • 'point': scatterplot with geom_point is created

  • 'col': barplot with geom_col is created

Value

ggplot object

Author(s)

Laure Cougnaud, Adriaan Blommaert


clinDataReview documentation built on March 7, 2023, 5:13 p.m.