blandr.plot.limits: Bland-Altman plot limits for R

View source: R/gg_blandAltman.r

blandr.plot.limitsR Documentation

Bland-Altman plot limits for R

Description

Works out plot limits for the Bland-Altman plots. Depends on the blandr.statistics function in the package.

Usage

blandr.plot.limits(
  statistics.results,
  lowest_y_axis = FALSE,
  highest_y_axis = FALSE
)

Arguments

statistics.results

A list of statistics generated by the blandr.statistics function: see the function's return list to see what variables are passed to this function

lowest_y_axis

(Optional) Defaults to NULL If given a continuous variable will use this as the lower boundary of the y axis. Useful if need multiple plots with equivalent y-axes.

highest_y_axis

(Optional) Defaults to NULL If given a continuous variable will use this as the upper boundary of the y axis. Useful if need multiple plots with equivalent y-axes.

Value

x_upper The upper limit of the X-axis

x_lower The lower limit of the X-axis

y_upper The upper limit of the Y-axis

y_lower The lower limit of the Y-axis

Author(s)

Deepankar Datta deepankardatta@nhs.net

Examples

# Generates two random measurements
measurement1 <- rnorm(100)
measurement2 <- rnorm(100)

# Passes data to the blandr.statistics function to generate Bland-Altman statistics
statistics.results <- blandr.statistics(measurement1, measurement2)

# Calls the function
blandr.plot.limits(statistics.results)

adamleejohnson/R-ajtools documentation built on April 4, 2022, 7:24 a.m.