plotGradient | R Documentation |
Plots an environmental gradient over one of the variables included in XData
plotGradient( hM, Gradient, predY, measure, xlabel = NULL, ylabel = NULL, index = 1, q = c(0.025, 0.5, 0.975), cicol = rgb(0, 0, 1, alpha = 0.5), pointcol = "lightgrey", pointsize = 1, showData = FALSE, jigger = 0, yshow = NA, showPosteriorSupport = TRUE, main, ... )
hM |
a fitted |
Gradient |
an object returned by |
predY |
an object returned by applying the function |
measure |
whether to plot species richness ("S"), an individual species ("Y") or community-weighted mean trait values ("T") |
xlabel |
label for x-axis |
ylabel |
label for y-axis |
index |
which species or trait to plot |
q |
quantiles of the credibility interval plotted |
cicol |
colour with which the credibility interval is plotted |
pointcol |
colour with which the data points are plotted |
pointsize |
size in which the data points are plotted |
showData |
whether raw data are plotted as well |
jigger |
the amount by which the raw data are to be jiggered in x-direction (for factors) or y-direction (for continuous covariates) |
yshow |
scale y-axis so that these values are also visible. This can used to scale y-axis so that it includes 0 and the expected maximum values. |
showPosteriorSupport |
add margin text on the posterior support of predicted change from gradient minimum to maximum for continuous gradients. |
main |
main title for the plot. |
... |
additional arguments for plot |
For measure
="Y", index
selects which species to plot from hM$spNames
.
For measure
="T", index
selects which trait to plot from hM$trNames
.
With measure
="S" the row sum of pred
is plotted,
and thus the interpretation of "species richness" holds only for probit models.
For Poisson models "S" shows the total count,
whereas for normal models it shows the summed response.
For measure
="T",
in probit model the weighting is over species occurrences,
whereas in count models it is over individuals.
In normal models, the weights are exp-transformed predictions to avoid negative weights
For the case of a continuous covariate, returns the posterior probability that the plotted variable is greater for the last sampling unit of the gradient than for the first sampling unit of the gradient. For the case of a factor, returns the plot object.
constructGradient
, predict
# Plot response of species 2 over the gradient of environmental variable x1 Gradient = constructGradient(TD$m, focalVariable="x1") predY = predict(TD$m, Gradient=Gradient) plotGradient(TD$m, Gradient, pred=predY, measure="Y", index = 2, showData = TRUE, jigger = 0.05) # Plot modelled species richness over the gradient of environmental variable x1 Gradient = constructGradient(TD$m, focalVariable="x1") predY = predict(TD$m, Gradient=Gradient) plotGradient(TD$m, Gradient, pred=predY, measure="S")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.