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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 12 19:43:45 CEST 2009


Author: jarioksa
Date: 2009-08-12 19:43:45 +0200 (Wed, 12 Aug 2009)
New Revision: 920

Added:
   pkg/vegan/R/estaccum.R
Modified:
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/specpool.Rd
Log:
estaccum: new function similar to poolaccum but using estimateR

Added: pkg/vegan/R/estaccum.R
===================================================================
--- pkg/vegan/R/estaccum.R	                        (rev 0)
+++ pkg/vegan/R/estaccum.R	2009-08-12 17:43:45 UTC (rev 920)
@@ -0,0 +1,21 @@
+##" Individual based accumulation model. Similar to poolaccum but uses
+##estimateR. Inherits from "poolaccum" class and uses its methods.
+`estaccumR` <-
+    function(x, permutations = 100)
+{
+    n <- nrow(x)
+    N <- seq_len(n)
+    S <- chao <- ace <- matrix(0, nrow = n, ncol = permutations)
+    for (i in 1:permutations) {
+        take <- sample(n)
+        tmp <- estimateR(apply(x, 2, cumsum))
+        S[,i] <- tmp[1,]
+        chao[,i] <- tmp[2,]
+        ace[, i] <- tmp[4,]
+    }
+    means <- cbind(N = N, S = rowMeans(S), Chao = rowMeans(chao),
+                   ACE = rowMeans(ace))
+    out <- list(S = S, chao = chao, ace = ace, N = N, means = means)
+    class(out) <- c("accumR", "poolaccum")
+    out
+}

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-08-12 16:40:59 UTC (rev 919)
+++ pkg/vegan/inst/ChangeLog	2009-08-12 17:43:45 UTC (rev 920)
@@ -10,6 +10,11 @@
 
 	* specaccum, specpool, specpool2vect and friends: index names are
 	now all lower-case.
+
+	* estaccum: new function similar to 'poolaccum', but uses
+	'estimateR' for individual (count) based estimates of extrapolated
+	richness. Inherits from 'poolaccum', but only 'print' works
+	recently. Still undocumented.
 	
 Version 1.16-22 (closed August 11, 2009)
 

Modified: pkg/vegan/man/specpool.Rd
===================================================================
--- pkg/vegan/man/specpool.Rd	2009-08-12 16:40:59 UTC (rev 919)
+++ pkg/vegan/man/specpool.Rd	2009-08-12 17:43:45 UTC (rev 920)
@@ -9,6 +9,8 @@
 \alias{estimateR.default}
 \alias{estimateR.matrix}
 \alias{estimateR.data.frame}
+\alias{estaccum}
+
 \title{ Extrapolated Species Richness in a Species Pool}
 \description{
   The functions estimate the extrapolated species richness in a species



More information about the Vegan-commits mailing list