Learn R Programming

vegan (version 2.0-10)

density.adonis: Kernel Density Estimation for Permutation Results in Vegan

Description

The density functions can directly access the permutation results of vegan functions, and plot can display the densities. The densityplot method can access and display the permutation results of functions that return permutations of several statistics simultaneously.

Usage

## S3 method for class 'adonis':
density(x, ...)
## S3 method for class 'vegandensity':
plot(x, main = NULL, xlab = NULL, ylab = "Density", 
   type = "l", zero.line = TRUE, obs.line = TRUE, ...)

Arguments

x
The object to be handled. For density and densityplot this is an object containing permutations. For plot this is a result of vegan density function.
main, xlab, ylab, type, zero.line
Arguments of plot.density and densityplot functions.
obs.line
Draw vertical line for the observed statistic. Logical value TRUE draws a red line, and FALSE draws nothing. Alternatively, obs.line can be a definition of the colour used for the line, either as a numeri
...
Other arguments passed to the function. In density these are passed to density.default.

Value

  • The density function returns the standard density result object with one new item: "observed" for the observed value of the statistic. The functions have a specific plot method, but otherwise they use methods for density.default, such as print and lines.

Details

The density and densityplot function can directly access permutation results of most vegan functions. The density function is identical to density.default and takes all its arguments, but adds the observed statistic to the result as item "observed". The observed statistic is also put among the permuted values so that the results are consistent with significance tests. The plot method is similar to the default plot.density, but can also add the observed statistic to the graph as a vertical line. The densityplot function is based on the same function in the lattice package (see densityplot).

The density methods are available for vegan functions adonis, anosim, mantel, mantel.partial, mrpp, permutest.cca, and protest. The density function for oecosimu is documented separately, and it is also used for adipart, hiersimu and multipart.

All vegan density functions return an object of class "vegandensity" inheriting from density, and can be plotted with its plot method. This is identical to the standard plot of densiy objects, but can also add a vertical line for the observed statistic.

Functions that can return several permuted statistics simultaneously also have densityplot method (adonis, oecosimu and diversity partitioning functions based on oecosimu). The standard density can only handle univariate data, and a warning is issued if the function is used for a model with several observed statistics. The densityplot method is available for adonis and oecosimu (documented separately). NB, there is no density method for anova.cca, but only for permutest.cca.

See Also

density.default.

Examples

Run this code
data(dune)
data(dune.env)
mod <- adonis(dune ~ Management, data = dune.env)
plot(density(mod))
mod <- adonis(dune ~ Management * Moisture, dune.env)
densityplot(mod)

Run the code above in your browser using DataLab