[Vegan-commits] r542 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 2 05:41:49 CET 2008


Author: psolymos
Date: 2008-11-02 05:41:49 +0100 (Sun, 02 Nov 2008)
New Revision: 542

Modified:
   pkg/R/permatfull.R
Log:
shuffle="both" retains matrix fill in permatfull


Modified: pkg/R/permatfull.R
===================================================================
--- pkg/R/permatfull.R	2008-11-01 07:55:10 UTC (rev 541)
+++ pkg/R/permatfull.R	2008-11-02 04:41:49 UTC (rev 542)
@@ -14,10 +14,10 @@
    names(out) <- NULL
    return(out)
 }
-bothshuffle <- function(x)
+bothshuffle <- function(x, y=1)
 {
-x[x!=0] <- indshuffle(x[x!=0])
-return(sample(x))
+    x[x!=0] <- indshuffle(x[x!=0] - y) + 1
+    return(sample(x))
 }
     if (!identical(all.equal(m, round(m)), TRUE))
        stop("function accepts only integers (counts)")



More information about the Vegan-commits mailing list