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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Oct 6 12:38:10 CEST 2011


Author: jarioksa
Date: 2011-10-06 12:38:10 +0200 (Thu, 06 Oct 2011)
New Revision: 1938

Modified:
   pkg/vegan/R/simulate.rda.R
   pkg/vegan/inst/ChangeLog
Log:
the 'data' argument (with 'nsim > 1') returns an estiamte of the original data

Modified: pkg/vegan/R/simulate.rda.R
===================================================================
--- pkg/vegan/R/simulate.rda.R	2011-10-06 08:38:37 UTC (rev 1937)
+++ pkg/vegan/R/simulate.rda.R	2011-10-06 10:38:10 UTC (rev 1938)
@@ -53,7 +53,7 @@
         ans <- ans[,,1]
         attributes(ans) <- attributes(ftd)
     } else {
-        attr(ans, "data") <- ftd
+        attr(ans, "data") <- round(ftd + object$CA$Xbar, 12)
         attr(ans, "method") <- paste("simulate", ifelse(is.null(indx),
                                                         "parametric", "index"))
         attr(ans, "binary") <- FALSE
@@ -131,7 +131,9 @@
         ans <- ans[,,1]
         attributes(ans) <- attributes(ftd)
     } else {
-        attr(ans, "data") <- ftd
+        obsdata <- ftd + object$CA$Xbar
+        obsdata <- (obsdata * sqrt(rc) + rc) * object$grand.total
+        attr(ans, "data") <- round(obsdata, 12)
         attr(ans, "method") <- paste("simulate", ifelse(is.null(indx),
                                                         "parametric", "index"))
         attr(ans, "binary") <- FALSE

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2011-10-06 08:38:37 UTC (rev 1937)
+++ pkg/vegan/inst/ChangeLog	2011-10-06 10:38:10 UTC (rev 1938)
@@ -6,15 +6,14 @@
 
 	* simulate.rda/cca: implemented 'nsim' or an option to generate an
 	array of simulated matrices inheriting from "simmat" object and
-	using print.simmat() for a compact display. The attr(x, "data")
-	needs consideration: now it is the fitted value, but this makes
-	little sense if we are using the result in oecosimu(). If 'nsim =
-	1', similar 2-dim matrix is returned as before so that
-	cca(simulate(mod)) still work. For 'nsim > 1', the 'indx' argument
-	should be compliant with permute::shuffleSet and the number of
-	rows in 'indx' gives the number of simulations. Implemented for
-	rda() and cca() results, but not for capscale() where simulate
-	returns a "dist" object which is nasty to pack into an array.
+	using print.simmat() for a compact display. If 'nsim = 1', similar
+	2-dim matrix is returned as before so that cca(simulate(mod))
+	still works. For 'nsim > 1', the 'indx' argument should have
+	'nsim' rows, but if 'nsim' is missing, number of rows in 'indx'
+	will give the number of simulations, and 'indx' can be made with
+	permute::shuffleSet().  Implemented for rda() and cca() results,
+	but not for capscale() where simulate returns a "dist" object
+	which is nasty to pack into an array.
 
 	* oecosimu: An attempt to set 'parallel' processing in evaluating
 	the statistic, and only evaluating the statistic -- the simulation



More information about the Vegan-commits mailing list