[Vegan-commits] r1083 - in pkg/vegan: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 16 07:13:01 CET 2009


Author: psolymos
Date: 2009-12-16 07:12:59 +0100 (Wed, 16 Dec 2009)
New Revision: 1083

Removed:
   pkg/vegan/R/permat.control.R
   pkg/vegan/R/twostagechao.R
   pkg/vegan/man/twostagechao.Rd
Modified:
   pkg/vegan/R/oecosimu.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/permatfull.Rd
Log:
deleting obsolete and incorrect functions, preparations for major release

Modified: pkg/vegan/R/oecosimu.R
===================================================================
--- pkg/vegan/R/oecosimu.R	2009-12-15 13:02:08 UTC (rev 1082)
+++ pkg/vegan/R/oecosimu.R	2009-12-16 06:12:59 UTC (rev 1083)
@@ -9,7 +9,7 @@
     if (!is.function(method)) {
         method <- match.arg(method, c("r00", "r0", "r1", "r2", "c0",
                                   "swap", "tswap", "backtrack", "quasiswap",
-                                  "r2dtable"))   # "permat" method added
+                                  "r2dtable"))
         if (method == "r2dtable") {
             nr <- rowSums(comm)
             nc <- colSums(comm)

Deleted: pkg/vegan/R/permat.control.R
===================================================================
--- pkg/vegan/R/permat.control.R	2009-12-15 13:02:08 UTC (rev 1082)
+++ pkg/vegan/R/permat.control.R	2009-12-16 06:12:59 UTC (rev 1083)
@@ -1,6 +0,0 @@
-`permat.control` <-
-function(ptype="full", mtype="count", method="quasiswap", fixedmar="both", shuffle="both", strata=NULL, burnin=0, thin=1)
-{
-list(ptype=ptype, mtype=mtype, method=method, fixedmar=fixedmar, shuffle=shuffle, strata=strata, burnin=burnin, thin=thin)
-}
-

Deleted: pkg/vegan/R/twostagechao.R
===================================================================
--- pkg/vegan/R/twostagechao.R	2009-12-15 13:02:08 UTC (rev 1082)
+++ pkg/vegan/R/twostagechao.R	2009-12-16 06:12:59 UTC (rev 1083)
@@ -1,47 +0,0 @@
-## Chao et al. 2008. Biometrics 64, 1178-1186
-twostagechao <- function(x, order=2, N=nrow(x), m=1, nboot=200, subset)
-{
-    DNAME <- deparse(substitute(x))
-    if (N < 2)
-        stop("provide 'N' >= 2")
-    if (missing(subset))
-        subset <- 1:N
-    X <- x[subset,]
-    if (N != nrow(X) || N != length(subset))
-        stop("'N' and 'subset' must conform")
-    tc <- colSums(X)
-    x <- xx <- decostand(X, "total")
-    if (m > 1)
-        x <- 1 - (1 - x)^m
-    spp <- ncol(x)
-    id <- cbind(unlist(lapply(2:spp, function(z) z:spp)),
-        rep(1:(spp-1), (spp-1):1))
-
-    FUN <- function(y) {
-        a <- sapply(1:spp, function(z) sum(y[,z])^order)
-        b <- sapply(1:spp, function(z) sum(y[,z]^order))
-        out <- ((1/(N^order - N)) * (sum(a - b))) / ((1/N) * sum(b))
-        out
-    }
-
-    if (nboot) {
-        BOOT <- sapply(1:spp, function(z) rmultinom(nboot, tc[z], xx[,z]))
-        BOOT <- array(BOOT, c(N, nboot, spp))
-        BOOTC <- sapply(1:nboot, function(z) FUN(BOOT[,z,]))
-    } else BOOTC <- NA
-
-    ESTIMATE <- FUN(x)
-    SE <- sd(BOOTC)
-    STATISTIC <- c(ESTIMATE, SE)
-    names(STATISTIC) <- c("Estimate", "Std. Error")
-    PARAMETER <- c(order, N)
-    names(PARAMETER) <- c("q", "N")
-    SETEXT <- if (nboot)
-        paste("(standard error is based on", nboot, "bootstrap samples)")
-        else ""
-    METHOD <- paste("Chao's two stage similarity index", SETEXT)
-
-    structure(list(statistic = STATISTIC, parameter = PARAMETER, 
-        p.value = NULL, method = METHOD, data.name = DNAME, observed = X, 
-        expected = NULL, residuals = NULL), class = c("twostagechao", "htest"))
-}

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-12-15 13:02:08 UTC (rev 1082)
+++ pkg/vegan/inst/ChangeLog	2009-12-16 06:12:59 UTC (rev 1083)
@@ -4,6 +4,12 @@
 
 Version 1.16-34 (opened December 13, 2009) -- (codename: Lucia)
 
+	* twostagechao: deleted, because question regarding the 
+	notation in the original article remained unanswered.
+
+	* permat.control: deleted, not needed any longer  due to changes
+	in oecosimu.
+
 	* goodness.cca: was not using correct weights. Broken in r992 (Sep
 	6, 2009). 
 

Modified: pkg/vegan/man/permatfull.Rd
===================================================================
--- pkg/vegan/man/permatfull.Rd	2009-12-15 13:02:08 UTC (rev 1082)
+++ pkg/vegan/man/permatfull.Rd	2009-12-16 06:12:59 UTC (rev 1083)
@@ -2,7 +2,6 @@
 \name{permat}
 \alias{permatfull}
 \alias{permatswap}
-\alias{permat.control}
 \alias{summary.permat}
 \alias{print.summary.permat}
 \alias{print.permat}
@@ -20,9 +19,6 @@
 mtype = "count", times = 99)
 permatswap(m, method = "quasiswap", fixedmar="both", shuffle = "both",
 strata = NULL, mtype = "count", times = 99, burnin = 0, thin = 1)
-permat.control(ptype = "full", mtype = "count", method = "quasiswap",
-fixedmar = "both", shuffle = "both", strata = NULL, 
-burnin = 0, thin = 1)
 \method{print}{permat}(x, digits = 3, ...)
 \method{summary}{permat}(object, ...)
 \method{print}{summary.permat}(x, digits = 2, ...)
@@ -87,9 +83,6 @@
 because same constraints are forced on submatrices of different dimensions. This
 often means, that the number of potential permutations will decrease with their dimensions.
 So the more constraints we put, the less randomness can be expected.
-
-The function \code{permat.control} is used to set up quantitative matrix permutations in other functions
-(e.g. \code{\link{oecosimu}} and \code{\link{adipart}}).
 }
 
 \value{

Deleted: pkg/vegan/man/twostagechao.Rd
===================================================================
--- pkg/vegan/man/twostagechao.Rd	2009-12-15 13:02:08 UTC (rev 1082)
+++ pkg/vegan/man/twostagechao.Rd	2009-12-16 06:12:59 UTC (rev 1083)
@@ -1,106 +0,0 @@
-\name{twostagechao}
-\Rdversion{1.1}
-\alias{twostagechao}
-\title{
-Multiple-Community Similarity Index
-}
-\description{
-The function implements the two-stage probabilistic approach to 
-multiple-community similarity indices proposed by Chao et al. (2008),
-extending the traditional pairwise comparisons of sites.
-}
-\usage{
-twostagechao(x, order = 2, N = nrow(x), m = 1, nboot = 200, subset)
-}
-\arguments{
-  \item{x}{
-A community matrix with rows as sites and columns as species.
-}
-  \item{order}{
-The order of the similarity, see details.
-}
-  \item{N}{
-The number of sites to use. By default it is the number of rows in \code{x}.
-If \code{N < ncol(x)}, then \code{N} and \code{subset} must conform 
-(\code{length(subset) == N}).
-}
-  \item{m}{
-The exponent used for calculating the NESS index variant, see details.
-}
-  \item{nboot}{
-Number of bootstrap samples to use for calculating standard error of the estimate.
-If \code{nboot = 0}, standard error is not computed.
-}
-  \item{subset}{
-Optional vector defining the subset of sites to use in the calculations.
-If this argument is provided, its length should equal \code{N}.
-}
-}
-\details{
-
-PUT DETAILS HERE
-
-}
-\value{
-The result is an object of class 'twostagechao' inheriting its structure from class 'htest'.
-}
-\references{
-Chao, A., Jost, L., Chiang, S. C., Jiang, Y.-H., Chazdon, R. L. (2008)
-A two-stage probabilistic approach to multiple-community similarity indices.
-\emph{Biometrics} \bold{64}, 1178--1186.
-
-Supplementary material at:
-\url{http://www.biometrics.tibs.org/datasets/070539.pdf}
-}
-\author{
-\enc{P\'eter S\'olymos}{Peter Solymos}, \email{solymos at ualberta.ca}
-}
-\seealso{
-\code{\link{dist}}, \code{\link{vegdist}}
-}
-\examples{
-data(BCI)
-twostagechao(BCI)
-res1 <- t(sapply(2:5, function(z) twostagechao(BCI, order=z)$statistic))
-rownames(res1) <- paste("Order =", 2:5)
-## similarity decreases as rare species get more weights
-res1
-## original example from Chao et al. 2008
-## supplementary material, LSUR Primary Plot
-lep1 <- structure(c(7L, 48L, 17L, 0L, 38L, 14L, 31L, 37L, 121L, 6L, 30L, 
-16L, 0L, 27L, 10L, 0L, 24L, 5L, 2L, 23L, 6L, 3L, 21L, 6L, 1L, 
-19L, 1L, 0L, 19L, 73L, 0L, 19L, 2L, 2L, 17L, 4L, 3L, 17L, 17L, 
-2L, 16L, 5L, 0L, 16L, 11L, 0L, 16L, 4L, 2L, 15L, 1L, 0L, 15L, 
-9L, 4L, 14L, 7L, 0L, 14L, 2L, 0L, 13L, 4L, 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0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 
-0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 
-2L, 0L, 0L, 2L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 3L, 0L, 0L, 2L, 0L, 
-0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L), .Dim = c(3L, 120L), .Dimnames = list(
-    c("Tree", "Sapling", "Seedling"), NULL))
-## compare values in Table 3 of Chao et al. 2008
-## (4th column, last 6 rows)
-## results are different!
-Order <- rep(2:3, 3)
-m <- c(1, 1, 5, 5, 10, 10)
-res2 <- t(sapply(1:6, function(z)
-    twostagechao(lep1, order=Order[z], m=m[z])$statistic))
-rownames(res2) <- c("Morisita C23", "Morisita C33", "NESS23(5)",
-    "NESS33(5)", "NESS23(10)", "NESS33(10)")
-res2
-}
-\keyword{ multivariate }



More information about the Vegan-commits mailing list