Skip to contents

Draws a simple base-R biplot of latent scores, with optional trait loadings overlaid, for a fit returned by gllvmTMB(). This method is a compatibility surface for users familiar with gllvm::ordiplot(); the package's richer ggplot-based model plots are available through plot(fit, type = ...).

Usage

ordiplot(fit, ...)

# S3 method for class 'gllvmTMB_multi'
ordiplot(
  fit,
  level = "unit",
  axes = c(1, 2),
  biplot = TRUE,
  rotate = c("none", "varimax", "promax"),
  ellipse = FALSE,
  ellipse_level = 0.95,
  ...
)

Arguments

fit

A fitted multivariate model returned by gllvmTMB().

...

Passed to plot().

level

"unit" (between-unit) or "unit_obs" (within-unit). Deprecated aliases "B" and "W" are still accepted with a warning.

axes

Length-2 integer vector picking which two latent axes to plot. Default c(1, 2).

biplot

Logical; if TRUE, overlay scaled trait loadings as arrows (default TRUE).

rotate

Rotation after fitting: "none" (default), "varimax", or "promax".

ellipse

Logical; if TRUE, draw an asymptotic-normal score -uncertainty ellipse around every site, from ordination_uncertainty(). Only supported with rotate = "none" (the default) – see ordination_uncertainty()'s Rotation section for why. The ellipse level is unmeasured for coverage; it is a standard Wald construction, not a certified interval.

ellipse_level

Nominal confidence level for the ellipse outline (default 0.95). Only used when ellipse = TRUE.

Value

Invisibly, a list with the plotted scores matrix and the corresponding loadings matrix. The function is primarily called for its plotting side effect.

Details

This is an S3 generic so that dispatch is robust to load order with the gllvm package — gllvm::ordiplot is itself an S3 generic, and if it is loaded after gllvmTMB it masks our function. With S3 methods registered, either generic correctly routes a multi-response fit through the gllvmTMB ordination method.

See also

plot.gllvmTMB_multi() for the available type choices; ordination_uncertainty() for the covariance ellipse = TRUE draws.