plot_quantiles: Plot Quantiles

View source: R/plot_quantiles.R

plot_quantilesR Documentation

Plot Quantiles

Description

This function plots the quantiles of two vectors against each other as either a QQ or an MD plot.

Usage

plot_quantiles(
  x,
  y,
  method = c("QQ", "MD"),
  pts = 1000L,
  title = ifelse(method == "QQ", "QQ Plot", "MD Plot"),
  xlab = NULL,
  ylab = NULL
)

Arguments

x

Vector of numeric values.

y

Second vector of numeric values for comparison.

method

Plot quantiles against quantiles (method = "QQ") or mean quantiles against difference in quantiles (method = "MD")?

pts

Number of points to plot.

xlab

Optional x-axis label.

ylab

Optional y-axis label.

main

Optional plot title.

Details

Quantile-quantile (QQ) and mean-difference (MD) plots visualize the relationship between two numeric vectors, or between expected and observed values for given variable. They are a quick and easy alternative to scatterplots when variables are of unequal length. They can slso help visually assess parametric goodness of fit.

Examples

x1 <- rnorm(100)
x2 <- runif(500)
plot_quantiles(x1, x2)
plot_quantiles(x1, x2, method = "MD")


dswatson/bioplotr documentation built on March 3, 2023, 9:43 p.m.