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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 8 20:53:12 CET 2012


Author: psolymos
Date: 2012-02-08 20:53:12 +0100 (Wed, 08 Feb 2012)
New Revision: 2072

Modified:
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/indpower.Rd
Log:
log and minor edits to previous commit of indpower

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-02-08 19:34:55 UTC (rev 2071)
+++ pkg/vegan/inst/ChangeLog	2012-02-08 19:53:12 UTC (rev 2072)
@@ -4,6 +4,12 @@
 
 Version 2.1-11 (opened February 5, 2012)
 
+    * indpower: now can handle input objects without dimnames.
+    This caused problems with oecosimu, because nullmodel
+    objects have no dimnames to save memory.
+    Extended example on indpower help page shows the p-value
+    and heterogeneity calculations soggested in Halme et al. 2009.
+
 	* adonis, anosim, mantel, mantel.partial, mrpp, permutest.cca: do
 	not need clusterEvalQ(parallel, library(vegan)) for socket
 	clusters. 

Modified: pkg/vegan/man/indpower.Rd
===================================================================
--- pkg/vegan/man/indpower.Rd	2012-02-08 19:34:55 UTC (rev 2071)
+++ pkg/vegan/man/indpower.Rd	2012-02-08 19:53:12 UTC (rev 2072)
@@ -61,9 +61,10 @@
 ## p value calculation for a species
 ## from Halme et al. 2009
 ## i is ID for the species
+i <- 1
 fun <- function(x, i) indpower(x)[i,-i]
 ## 'c0' randomizes species occurrences
-os <- oecosimu(dune, fun, "c0", i=1, nsimul=99)
+os <- oecosimu(dune, fun, "c0", i=i, nsimul=99)
 ## get z values from oecosimu output
 z <- os$oecosimu$z
 ## p-value
@@ -72,11 +73,12 @@
 (chi2 <- sum((z - mean(z))^2))
 pchisq(chi2, df=length(z)-1)
 ## Halme et al.'s suggested output
-out <- c(TIP=TIP[1], 
+out <- c(TIP=TIP[i], 
     significance=p,
     heterogeneity=chi2,
-    minIP=min(fun(dune, i=1)),
-    varIP=sd(fun(dune, i=1)^2))
+    minIP=min(fun(dune, i=i)),
+    varIP=sd(fun(dune, i=i)^2))
+out
 }
 \keyword{ multivariate }
 



More information about the Vegan-commits mailing list