biPlot: biPlot

View source: R/biPlot.R

biPlotR Documentation

biPlot

Description

Constructs an ordination biplot based on the fitted model

Usage

biPlot(
  hM,
  etaPost,
  lambdaPost,
  factors = c(1, 2),
  colVar = NULL,
  colors = NULL,
  spNames = hM$spNames,
  ...
)

Arguments

hM

a fitted Hmsc model object

etaPost

posterior distribution of site loadings (Eta)

lambdaPost

posterior distribution of species loadings (Lambda)

factors

indices of the two factors to be plotted

colVar

the environmental covariate from XData according to which the sites are to be coloured

colors

controls the colors of the heatmap. For continuous covariates, colors should be given as a name of palette, with default value colorRampPalette(c("blue","white","red")), or as a vector of colours. For factors, colors should be given as a vector of colours, e.g. c("blue","red").

spNames

a vector of species names to be added to the ordination diagram

...

other parameters passed to the function.

Examples

# Construct an ordination biplot using two chosen latent factors from a previously fitted HMSC model
etaPost = getPostEstimate(TD$m, "Eta")
lambdaPost=getPostEstimate(TD$m, "Lambda")
biPlot(TD$m, etaPost = etaPost, lambdaPost=lambdaPost, factors=c(1,2))



Hmsc documentation built on Aug. 11, 2022, 5:11 p.m.