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

Description Usage Arguments Details Value Author(s) See Also Examples

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

1
2
3
4
5
## 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 numerical value from the palette or as the name of the colour, or other normal definition of the colour.

...

Other arguments passed to the function. In density these are passed to density.default.

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.

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.

Author(s)

Jari Oksanen

See Also

density.default.

Examples

1
2
3
4
5
6
data(dune)
data(dune.env)
mod <- adonis(dune ~ Management, data = dune.env)
plot(density(mod))
mod <- adonis(dune ~ Management * Moisture, dune.env)
densityplot(mod)

pattakosn/Rworkshop documentation built on May 24, 2019, 8:22 p.m.