[Vegan-commits] r2264 - in pkg/vegan: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Sep 2 17:48:37 CEST 2012
Author: jarioksa
Date: 2012-09-02 17:48:37 +0200 (Sun, 02 Sep 2012)
New Revision: 2264
Added:
pkg/vegan/man/density.adonis.Rd
Modified:
pkg/vegan/R/density.anosim.R
pkg/vegan/man/adonis.Rd
pkg/vegan/man/anosim.Rd
pkg/vegan/man/anova.cca.Rd
pkg/vegan/man/mantel.Rd
pkg/vegan/man/mrpp.Rd
pkg/vegan/man/procrustes.Rd
Log:
separate documentation of vegan density methods
Modified: pkg/vegan/R/density.anosim.R
===================================================================
--- pkg/vegan/R/density.anosim.R 2012-09-02 06:54:12 UTC (rev 2263)
+++ pkg/vegan/R/density.anosim.R 2012-09-02 15:48:37 UTC (rev 2264)
@@ -115,7 +115,7 @@
if (is.null(main))
main <- deparse(x$call)
## adjust xlim of obs.line if needed
- if (obs.line) {
+ if (is.character(obs.line) || obs.line) {
xlim <- range(c(x$x, x$observed), na.rm = TRUE)
## change obs.line to col=2 (red) if it was logical TRUE
if (isTRUE(obs.line))
@@ -132,7 +132,7 @@
xlim = xlim, ...)
if (zero.line)
abline(h = 0, lwd = 0.1, col = "gray")
- if (obs.line)
+ if (is.character(obs.line) || obs.line)
abline(v = x$observed, col = obs.line)
invisible(NULL)
}
Modified: pkg/vegan/man/adonis.Rd
===================================================================
--- pkg/vegan/man/adonis.Rd 2012-09-02 06:54:12 UTC (rev 2263)
+++ pkg/vegan/man/adonis.Rd 2012-09-02 15:48:37 UTC (rev 2264)
@@ -1,7 +1,6 @@
\encoding{UTF-8}
\name{adonis}
\alias{adonis}
-\alias{density.adonis}
\title{Permutational Multivariate Analysis of Variance Using Distance Matrices}
@@ -139,8 +138,8 @@
\item{f.perms}{ an \eqn{N} by \eqn{m} matrix of the null \eqn{F}
statistics for each source of variation based on \eqn{N}
permutations of the data. The distribution of a single term can be
- inspected with \code{\link{density}} function, or all terms
- simultaneously with \code{densityplot}.}
+ inspected with \code{\link{density.adonis}} function, or all terms
+ simultaneously with \code{densityplot.adonis}.}
\item{model.matrix}{The \code{\link{model.matrix}} for the right hand
side of the formula.}
\item{terms}{The \code{\link{terms}} component of the model.}
Modified: pkg/vegan/man/anosim.Rd
===================================================================
--- pkg/vegan/man/anosim.Rd 2012-09-02 06:54:12 UTC (rev 2263)
+++ pkg/vegan/man/anosim.Rd 2012-09-02 15:48:37 UTC (rev 2264)
@@ -2,7 +2,6 @@
\alias{anosim}
\alias{summary.anosim}
\alias{plot.anosim}
-\alias{density.anosim}
\title{ Analysis of Similarities }
\description{
@@ -77,7 +76,7 @@
\item{statistic}{The value of ANOSIM statistic \eqn{R}}
\item{signif}{Significance from permutation.}
\item{perm}{Permutation values of \eqn{R}. The distribution of
- permutation values can be inspected with function \code{density}.}
+ permutation values can be inspected with function \code{\link{density.anosim}}.}
\item{class.vec}{Factor with value \code{Between} for dissimilarities
between classes and class name for corresponding dissimilarity
within class.}
Modified: pkg/vegan/man/anova.cca.Rd
===================================================================
--- pkg/vegan/man/anova.cca.Rd 2012-09-02 06:54:12 UTC (rev 2263)
+++ pkg/vegan/man/anova.cca.Rd 2012-09-02 15:48:37 UTC (rev 2264)
@@ -8,7 +8,6 @@
\alias{permutest}
\alias{permutest.default}
\alias{permutest.cca}
-\alias{density.permutest.cca}
\title{Permutation Test for Constrained Correspondence Analysis,
Redundancy Analysis and Constrained Analysis of Principal Coordinates }
@@ -143,9 +142,10 @@
Function \code{permutest.cca} returns an object of class
\code{"permutest.cca"}, which has its own \code{print} method. The
distribution of permuted \eqn{F} values can be inspected with
- \code{density} function. The function \code{anova.cca} calls
- \code{permutest.cca}, fills an \code{\link{anova}} table and uses
- \code{\link{print.anova}} for printing.
+ \code{\link{density.permutest.cca}} function. The function
+ \code{anova.cca} calls \code{permutest.cca}, fills an
+ \code{\link{anova}} table and uses \code{\link{print.anova}} for
+ printing.
}
\note{
Added: pkg/vegan/man/density.adonis.Rd
===================================================================
--- pkg/vegan/man/density.adonis.Rd (rev 0)
+++ pkg/vegan/man/density.adonis.Rd 2012-09-02 15:48:37 UTC (rev 2264)
@@ -0,0 +1,112 @@
+\name{density.adonis}
+\alias{density.adonis}
+\alias{density.anosim}
+\alias{density.mantel}
+\alias{density.mrpp}
+\alias{density.permutest.cca}
+\alias{density.protest}
+\alias{plot.vegandensity}
+\alias{densityplot.adonis}
+
+\title{
+ Kernel Density Estimation for Permutation Results in Vegan
+}
+
+\description{
+ The \code{density} functions can directly access the permutation
+ results of \pkg{vegan} functions, and \code{plot} can display the
+ densities. The \code{densityplot} method can access and display the
+ permutation results of functions that return permutations of several
+ statistics simultaneously.
+}
+
+\usage{
+\method{density}{adonis}(x, ...)
+\method{plot}{vegandensity}(x, main = NULL, xlab = NULL, ylab = "Density",
+ type = "l", zero.line = TRUE, obs.line = FALSE, ...)
+}
+
+\arguments{
+ \item{x}{The object to be handled. For \code{density} and
+ \code{densityplot} this is an object containing permutations. For
+ \code{plot} this is a result of \pkg{vegan} \code{density}
+ function. }
+ \item{main, xlab, ylab, type, zero.line}{Arguments of
+ \code{\link{plot.density}} and \code{\link[lattice]{densityplot}}
+ functions.}
+ \item{obs.line}{Draw vertical line for the observed
+ statistic. Logical value \code{TRUE} draws a red line, and
+ \code{FALSE} draws nothing. Alternatively, this can be a
+ definition of the colour used for the line, either as a numerical
+ value from the \code{\link[grDevices]{palette}} or a the name of
+ the colour, or other vallid definition of the colour.}
+ \item{\dots}{ Other arguments passed to the function. In
+ \code{density} these are passed to \code{\link{density.default}}.}
+}
+
+\details{
+
+ The \code{density} and \code{densityplot} function can directly
+ access permutation results of most \pkg{vegan} functions. The
+ \code{density} function is identical to
+ \code{\link{density.default}} and takes all its arguments, but adds
+ the observed statistic to the result as item \code{"observed"}. The
+ \code{plot} method is similar to the default
+ \code{\link{plot.density}}, but can also add the observed statistic
+ to the graph as a vertical lline. The \code{densityplot} function
+ is based on the same function in the \pkg{lattice} package (see
+ \code{\link[lattice]{densityplot}}).
+
+ The density methods are available for \pkg{vegan} functions
+ \code{\link{adonis}}, \code{\link{anosim}}, \code{\link{mantel}},
+ \code{\link{mantel.partial}}, \code{\link{mrpp}},
+ \code{\link{permutest.cca}}, and \code{\link{protest}}. The
+ \code{density} function for \code{\link{oecosimu}} is documented
+ separately, and it is also used for \code{\link{adipart}},
+ \code{\link{hiersimu}} and \code{\link{multipart}}.
+
+ All \pkg{vegan} \code{density} functions return an object q of
+ classes \code{"vegandensity"} inheriting from \code{\link{density}},
+ and can be plotted with its \code{plot} method. This is identical
+ to the standard \code{plot} of \code{densiy} objects, but can also
+ add a vertical line for the observed statistic.
+
+ Functions that can return for several permuted statistics
+ simultaenously also have \code{\link[lattice]{densityplot}} method.
+ The standard \code{\link{density}} can only handle univariate data,
+ and a warning is issued it such a function is used for a model with
+ several observed statistic. The \code{\link[lattice]{densityplot}}
+ method is available for \code{\link{adonis}} and
+ \code{\link{oecosimu}} (documented separately). NB, there is no
+ \code{density} method for \code{\link{anova.cca}}, but only for
+ \code{\link{permutest.cca}}.
+
+}
+
+\value{
+ The \code{density} function returns the standard
+ \code{\link{density}} result object with one new item:
+ \code{"observed"} for the observed value of the statistic.
+}
+
+
+\author{
+ Jari Oksanen
+}
+
+\seealso{
+ \code{\link{density.default}}.
+}
+
+\examples{
+data(dune)
+data(dune.env)
+mod <- adonis(dune ~ Management, data = dune.env)
+plot(density(mod))
+library(lattice)
+mod <- adonis(dune ~ Management * Moisture, dune.env)
+densityplot(mod)
+}
+
+\keyword{ distribution }
+\keyword{ smooth }
Modified: pkg/vegan/man/mantel.Rd
===================================================================
--- pkg/vegan/man/mantel.Rd 2012-09-02 06:54:12 UTC (rev 2263)
+++ pkg/vegan/man/mantel.Rd 2012-09-02 15:48:37 UTC (rev 2264)
@@ -1,7 +1,6 @@
\name{mantel}
\alias{mantel}
\alias{mantel.partial}
-\alias{density.mantel}
\title{Mantel and Partial Mantel Tests for Dissimilarity Matrices }
\description{
@@ -65,7 +64,8 @@
\item{statistic}{The Mantel statistic.}
\item{signif}{Empirical significance level from permutations.}
\item{perm}{A vector of permuted values. The distribution of
- permuted values can be inspected with \code{density} funciton.}
+ permuted values can be inspected with \code{\link{density.mantel}}
+ function.}
\item{permutations}{Number of permutations.}
}
\references{ The test is due to Mantel, of course, but the
Modified: pkg/vegan/man/mrpp.Rd
===================================================================
--- pkg/vegan/man/mrpp.Rd 2012-09-02 06:54:12 UTC (rev 2263)
+++ pkg/vegan/man/mrpp.Rd 2012-09-02 15:48:37 UTC (rev 2264)
@@ -3,7 +3,6 @@
\alias{meandist}
\alias{summary.meandist}
\alias{plot.meandist}
-\alias{density.mrpp}
\title{Multi Response Permutation Procedure and Mean Dissimilarity Matrix}
@@ -145,7 +144,7 @@
\item{weight.type}{The choice of group weights used.}
\item{boot.deltas}{The vector of "permuted deltas," the deltas
calculated from each of the permuted datasets. The distribution of
- this item can be inspected with \code{density} function.}
+ this item can be inspected with \code{\link{density.mrpp}} function.}
\item{permutations}{The number of permutations used.}
}
\references{
Modified: pkg/vegan/man/procrustes.Rd
===================================================================
--- pkg/vegan/man/procrustes.Rd 2012-09-02 06:54:12 UTC (rev 2263)
+++ pkg/vegan/man/procrustes.Rd 2012-09-02 15:48:37 UTC (rev 2264)
@@ -9,7 +9,6 @@
\alias{fitted.procrustes}
\alias{predict.procrustes}
\alias{protest}
-\alias{density.protest}
\title{Procrustes Rotation of Two Configurations and PROTEST }
\description{
@@ -163,7 +162,8 @@
\item{t0}{This and the following items are only in class
\code{protest}: Procrustes correlation from non-permuted solution.}
\item{t}{Procrustes correlations from permutations. The distribution
- of these correlations can be ispected with \code{density} function.}
+ of these correlations can be inspected with \code{\link{density.protest}}
+ function.}
\item{signif}{`Significance' of \code{t}}
\item{permutations}{Number of permutations.}
\item{strata}{The name of the stratifying variable.}
More information about the Vegan-commits
mailing list