Learn R Programming

VGAM (version 1.1-14)

trplot.qrrvglm: Trajectory plot for QRR-VGLMs

Description

Produces a trajectory plot for quadratic reduced-rank vector generalized linear models (QRR-VGLMs). It is only applicable for rank-1 models with argument noRRR = ~ 1.

Usage

trplot.qrrvglm(object, which.species = NULL, add = FALSE,
               show.plot = TRUE,
               label.sites = FALSE, sitenames = rownames(object@y),
               axes.equal = TRUE, cex = par()$cex,
               col = 1:(nos * (nos - 1)/2), log = "",
               lty = rep_len(par()$lty, nos * (nos - 1)/2),
               lwd = rep_len(par()$lwd, nos * (nos - 1)/2),
               tcol = rep_len(par()$col, nos * (nos - 1)/2),
               xlab = NULL, ylab = NULL, main = "",
               type = "b", asp = NULL, check.ok = TRUE, ...)

Arguments

Value

A list with the following components.

species.names

A matrix of characters giving the `first' and `second' species. The number of different combinations of species is given by the number of rows. This is useful for creating a legend.

sitenames

A character vector of site names, sorted by the latent variable (from low to high).

Details

A trajectory plot plots the fitted values of a `second' species against a `first' species. The argument which.species must therefore contain at least two species. By default, all of the species that were fitted in object are plotted. With more than a few species the resulting plot will be very congested, and so it is recommended that only a few species be selected for plotting.

In the above, \(M\) is the number of species selected for plotting, so there will be \(M(M-1)/2\) curves/trajectories in total.

A trajectory plot will be fitted only if noRRR = ~ 1 because otherwise the trajectory will not be a smooth function of the latent variables.

References

Yee, T. W. (2020). On constrained and unconstrained quadratic ordination. Manuscript in preparation.

See Also

cqo, par, title.

Examples

Run this code
if (FALSE)  set.seed(111)  # Leads to the global solution
# hspider[,1:6] <- scale(hspider[,1:6])  # Stdze the environ vars
p1 <- cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute,
                Arctperi, Auloalbi, Pardlugu, Pardmont,
                Pardnigr, Pardpull, Trocterr, Zoraspin) ~
          WaterCon + BareSand + FallTwig + CoveMoss +
          CoveHerb + ReflLux,
          poissonff, data = hspider, trace = FALSE)

trplot(p1, which.species = 1:3, log = "xy", type = "b", lty = 1,
       main = "Trajectory plot of three hunting spiders species",
       col = c("blue","red","green"), lwd = 2, label = TRUE) -> ii
legend(0.00005, 0.3, lwd = 2, lty = 1,
       col = c("blue", "red", "green"),
       with(ii, paste(species.names[,1], species.names[,2],
                      sep = " and ")))
abline(a = 0, b = 1, lty = "dashed", col = "grey")  # Ref. line

Run the code above in your browser using DataLab