addReferenceLinesClinDataPlot: Add reference (horizontal/vertical/diagonal) lines to a...

Description Usage Arguments Value Author(s)

View source: R/plots-utility-referenceLines.R

Description

Add reference (horizontal/vertical/diagonal) lines to a clinical data plot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
addReferenceLinesClinDataPlot(
  gg,
  data,
  xVar,
  yVar,
  xLim = NULL,
  yLim = NULL,
  refLinePars = NULL,
  facetPars = NULL
)

Arguments

gg

ggplot object.

data

Data.frame with data.

xVar

String with column of data containing x-variable.

yVar

String with column of data containing y-variable.

xLim

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

yLim

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

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.

facetPars

List with facetting parameters, passed to the facetting function. Variables should be specified as character or formula. For 'wrap' facetting (facetType is 'wrap'), if the layout is not specified via nrow/ncol, 2 columns are used by default.

Value

Updated ggplot object.

Author(s)

Laure Cougnaud


clinDataReview documentation built on July 14, 2021, 5:08 p.m.