plotGamma: plotGamma

View source: R/plotGamma.R

plotGammaR Documentation

plotGamma

Description

Plots heatmaps of parameter estimates or posterior support values of trait effects on species' environmental responses, i.e. how environmental responses in Beta responds to covariates in X

Usage

plotGamma(
  hM,
  post,
  param = "Support",
  trOrder = "Original",
  trVector = NULL,
  covOrder = "Original",
  covVector = NULL,
  trNamesNumbers = c(TRUE, TRUE),
  covNamesNumbers = c(TRUE, TRUE),
  supportLevel = 0.9,
  main = NULL,
  cex = c(0.8, 0.8, 0.8),
  colors = colorRampPalette(c("blue", "white", "red")),
  colorLevels = NULL,
  mar = c(6, 9, 2, 0),
  smallplot = NULL,
  bigplot = NULL,
  newplot = TRUE
)

Arguments

hM

a fitted Hmsc model object

post

posterior summary of Gamma parameters obtained from getPostEstimate

param

controls which parameter is plotted, current options include "Mean" for posterior mean estimate, "Support" for the level of statistical support measured by posterior probability for a positive or negative response, and "Sign" to indicate whether the response is positive, negative, or neither of these given the chosen supportLevel

trOrder

controls the ordering of traits, current options are "Original", and "Vector". If trOrder = "Vector", an ordering vector must be provided (see trVector)

trVector

controls the ordering of traits if trOrder = "Vector". If a subset of traits are listed, only those will be plotted

covOrder

controls the ordering of covariates, current options are "Original" and "Vector". If covOrder = "Vector", an ordering vector must be provided (see covVector)

covVector

controls the ordering of covariates if covOrder = "Vector". If a subset of covariates are listed, only those will be plotted

trNamesNumbers

logical of length 2, where first entry controls whether trait names are added to axes, and second entry controls whether traits numbers are added

covNamesNumbers

logical of length 2, where first entry controls whether covariate names are added to axes, and second entry controls whether covariate numbers are added

supportLevel

controls threshold posterior support for plotting

main

main title for the plot

cex

controls character expansion (font size). Three values, controlling covariate names, trait names, and color legend axis labels

colors

controls the colors of the heatmap, default value colorRampPalette(c("blue","white","red"))

colorLevels

number of color levels used in the heatmap

mar

plotting margins

smallplot

passed to image.plot

bigplot

passed to image.plot

newplot

set to false if the plot will be part of multi-panel plot

Examples

# Plot posterior support values of trait effects on environmental responses
gammaPost=getPostEstimate(TD$m, "Gamma")
plotGamma(TD$m, post=gammaPost, param="Support")

# Plot parameter estimates of trait effects on environmental responses
gammaPost=getPostEstimate(TD$m, "Gamma")
plotGamma(TD$m, post=gammaPost, param="Mean")


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