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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 29 14:06:21 CET 2009


Author: jarioksa
Date: 2009-11-29 14:06:21 +0100 (Sun, 29 Nov 2009)
New Revision: 1074

Modified:
   pkg/vegan/R/simulate.rda.R
   pkg/vegan/inst/ChangeLog
Log:
simulate.rda works with pRDA

Modified: pkg/vegan/R/simulate.rda.R
===================================================================
--- pkg/vegan/R/simulate.rda.R	2009-11-29 10:32:11 UTC (rev 1073)
+++ pkg/vegan/R/simulate.rda.R	2009-11-29 13:06:21 UTC (rev 1074)
@@ -1,9 +1,6 @@
 `simulate.rda` <-
     function(object, nsim = 1, seed = NULL, indx = NULL, ...) 
 {
-    ## First check cases that won't work (yet?)
-    if (!is.null(object$pCCA))
-        stop("not yet implemented for partial models")
     ## Handle RNG: code directly from stats::simulate.lm
     if (!exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE)) 
         runif(1)
@@ -20,6 +17,9 @@
     if (nsim > 1)
         .NotYetUsed("nsim")
     ftd <- fitted(object)
+    ## pRDA: add partial Fit to the constrained
+    if (!is.null(object$pCCA))
+        ftd <- ftd + object$pCCA$Fit
     if (is.null(indx))
         ans <- as.data.frame(ftd + matrix(rnorm(length(ftd), 
                sd = outer(rep(1,nrow(ftd)), sd(object$CA$Xbar))), 

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-11-29 10:32:11 UTC (rev 1073)
+++ pkg/vegan/inst/ChangeLog	2009-11-29 13:06:21 UTC (rev 1074)
@@ -22,7 +22,8 @@
 	values. Experimental, low level interface that requires giving the
 	index of right length. The permutation index can contain
 	duplicates such as from sample(nrow(data), replace = TRUE) so that
-	bootstrapping is possible unlike in anova.cca/permutest.cca. 
+	bootstrapping is possible unlike in anova.cca/permutest.cca. Works
+	now with partial model: adds partial fit to the constrained fit.
 	
 Version 1.16-32 (closed November 13, 2009)
 



More information about the Vegan-commits mailing list