plot.lme.morph: Plot Morphometric Data and Estimated Relationships

View source: R/plot.R

plot.lme.morphR Documentation

Plot Morphometric Data and Estimated Relationships

Description

An S3 method that plots morphometric data, estimated relationships between dimensions, or both, from a fitted model object returned by fit.morph().

Usage

## S3 method for class 'lme.morph'
plot(
  x,
  dims = c(1, 2),
  type = "data",
  line.type = "lm",
  confints = !add,
  add = FALSE,
  reverse.axes = FALSE,
  plot.data = TRUE,
  xlim = NULL,
  ylim = NULL,
  xlab = NULL,
  ylab = NULL,
  ...
)

Arguments

x

An object of class lme.morph, returned by fit.morph().

dims

An integer vector of length two, indicating which dimensions will appear on the x- and y-axes, respectively.

type

A character string specifying the plot type. If "ratio", then the y-axis represents the ratio between measurements of the two dimensions. If "data", then the raw data are plotted.

line.type

A character string specifying the type of fitted line to overlay. If "lm", then a line with the same interpretation as linear regression is plotted. If "pca", then the reduced major axis (or principal component axis) summarising the relationship is plotted.

confints

Logical. If TRUE, then confidence intervals are plotted.

add

Logical. If TRUE, then fitted lines are added to an existing plot.

reverse.axes

Logical. If TRUE, then a line of type "lm" will provide the expected value of the x-axis variable conditional on the y-axis variable, rather than the other way around. Only use reverse.axes = TRUE to add to an existing plot. For a new plot, simply reverse the order of the elements in dims.

plot.data

Logical. If FALSE then the data are not plotted.

xlim, ylim

Limits for the axes.

xlab, ylab

Titles for the axes.

...

Additional arguments passed to graphics::abline() and graphics::lines() to modify the appearance of the fitted lines.

Value

No return value. Called to produce a plot.

Examples

## Fitting model to manta ray data.
fit <- fit.morph(manta)
## Plotting dimensions 1 and 2 with a fitted linear regression
## line.
plot(fit)
## Same again, but plotting the reduced major axis (or principal
## component axis) for dimensions 1 and 3.
plot(fit, dims = c(1, 3), line.type = "pca")
## A plot showing how the ratio between dimensions 2 and 3 changes
## with the size of dimension 3. Because the line is quite flat,
## it's plausible the relationship is isometric.
plot(fit, dims = c(3, 2), type = "ratio", line.type = "pca")
## On the other hand, the relationship between dimensions 1 and 2
## is clearly allometric.
plot(fit, dims = c(3, 1), type = "ratio", line.type = "pca")

morphErr documentation built on Aug. 30, 2026, 5:06 p.m.