[Vegan-commits] r1864 - pkg/vegan/tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 20 20:09:15 CEST 2011


Author: jarioksa
Date: 2011-09-20 20:09:15 +0200 (Tue, 20 Sep 2011)
New Revision: 1864

Modified:
   pkg/vegan/tests/Examples/vegan-Ex.Rout.save
Log:
update

Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save
===================================================================
--- pkg/vegan/tests/Examples/vegan-Ex.Rout.save	2011-09-20 18:04:39 UTC (rev 1863)
+++ pkg/vegan/tests/Examples/vegan-Ex.Rout.save	2011-09-20 18:09:15 UTC (rev 1864)
@@ -23,7 +23,7 @@
 > options(warn = 1)
 > library('vegan')
 Loading required package: permute
-This is vegan 2.1-0
+This is vegan 2.1-1
 > 
 > assign(".oldSearch", search(), pos = 'CheckExEnv')
 > cleanEx()
@@ -161,7 +161,7 @@
 
 Formula:
 y ~ poly(x1, 1) + poly(x2, 1)
-<environment: 0x10221d350>
+<environment: 0x102618468>
 Total model degrees of freedom 3 
 
 GCV score: 0.0427924
@@ -1830,6 +1830,96 @@
 > 
 > 
 > cleanEx()
+> nameEx("commsim")
+> ### * commsim
+> 
+> flush(stderr()); flush(stdout())
+> 
+> ### Name: commsim
+> ### Title: Create a Object for Null Model Algorithms
+> ### Aliases: commsim make.commsim print.commsim
+> ### Keywords: multivariate datagen
+> 
+> ### ** Examples
+> 
+> ## write the r00 algorithm
+> f <- function(x, n, ...) 
++     array(replicate(n, sample(x)), c(dim(x), n))
+> (cs <- commsim("r00", fun=f, binary=TRUE, 
++     isSeq=FALSE, mode="integer"))
+An object of class "commsim"
+"r00" method (binary, non-sequential, integer mode)
+
+> 
+> ## retrieving the sequential swap algorithm
+> make.commsim("swap")
+An object of class "commsim"
+"swap" method (binary, sequential, integer mode)
+
+> 
+> ## structural constraints
+> diagfun <- function(x, y) {
++     c(sum = sum(y) == sum(x),
++         fill = sum(y > 0) == sum(x > 0),
++         rowSums = all(rowSums(y) == rowSums(x)),
++         colSums = all(colSums(y) == colSums(x)),
++         rowFreq = all(rowSums(y > 0) == rowSums(x > 0)),
++         colFreq = all(colSums(y > 0) == colSums(x > 0)))
++ }
+> evalfun <- function(meth, x, n) {
++     m <- nullmodel(x, meth)
++     y <- simulate(m, nsim=n)
++     out <- rowMeans(sapply(1:dim(y)[3], 
++         function(i) diagfun(attr(y, "data"), y[,,i])))
++     z <- as.numeric(c(attr(y, "binary"), attr(y, "isSeq")))
++     names(z) <- c("binary", "isSeq")
++     c(z, out)
++ }
+> x <- matrix(rbinom(10*12, 1, 0.5)*rpois(10*12, 3), 12, 10)
+> a <- t(sapply(c("r00","r0","r1","r2","c0",
++     "swap","tswap","quasiswap","backtrack",
++     "r2dtable","swap_count","quasiswap_count",
++     "swsh_samp","swsh_both","abuswap_r","abuswap_c",
++     "swsh_samp_r","swsh_samp_c","swsh_both_r","swsh_both_c",
++     "r00_ind","r0_ind","c0_ind",
++     "r00_samp","r0_samp","c0_samp",
++     "r00_both","r0_both","c0_both"), 
++     evalfun, x=x, n=10))
+> print(as.table(ifelse(a==1,1,0)), zero.print = ".")
+                binary isSeq sum fill rowSums colSums rowFreq colFreq
+r00                  1     .   1    1       .       .       .       .
+r0                   1     .   1    1       1       .       1       .
+r1                   1     .   1    1       1       .       1       .
+r2                   1     .   1    1       1       .       1       .
+c0                   1     .   1    1       .       1       .       1
+swap                 1     1   1    1       1       1       1       1
+tswap                1     1   1    1       1       1       1       1
+quasiswap            1     .   1    1       1       1       1       1
+backtrack            1     .   1    1       1       1       1       1
+r2dtable             .     .   1    .       1       1       .       .
+swap_count           .     1   1    1       1       1       1       1
+quasiswap_count      .     .   1    1       1       1       .       .
+swsh_samp            .     .   1    1       .       .       1       1
+swsh_both            .     .   1    1       .       .       1       1
+abuswap_r            .     1   1    1       1       1       1       1
+abuswap_c            .     1   1    1       1       1       1       1
+swsh_samp_r          .     .   1    1       1       .       1       1
+swsh_samp_c          .     .   1    1       .       1       1       1
+swsh_both_r          .     .   1    1       1       .       1       1
+swsh_both_c          .     .   1    1       .       1       1       1
+r00_ind              .     .   1    .       .       .       .       .
+r0_ind               .     .   1    .       1       .       .       .
+c0_ind               .     .   1    .       .       1       .       .
+r00_samp             .     .   1    1       .       .       .       .
+r0_samp              .     .   1    1       1       .       1       .
+c0_samp              .     .   1    1       .       1       .       1
+r00_both             .     .   1    1       .       .       .       .
+r0_both              .     .   1    1       1       .       1       .
+c0_both              .     .   1    1       .       1       .       1
+> 
+> 
+> 
+> cleanEx()
 > nameEx("contribdiv")
 > ### * contribdiv
 > 
@@ -4085,6 +4175,97 @@
 > 
 > 
 > cleanEx()
+> nameEx("nullmodel")
+> ### * nullmodel
+> 
+> flush(stderr()); flush(stdout())
+> 
+> ### Name: nullmodel
+> ### Title: Null Model and Simulation
+> ### Aliases: nullmodel print.nullmodel simulate.nullmodel update.nullmodel
+> ###   print.simmat
+> ### Keywords: multivariate datagen
+> 
+> ### ** Examples
+> 
+> x <- matrix(rbinom(10*12, 1, 0.5)*rpois(10*12, 3), 12, 10)
+> 
+> ## non-sequential nullmodel
+> (nm <- nullmodel(x, "r00"))
+An object of class "nullmodel"
+"r00" method (binary, non-sequential)
+12 x 10 matrix
+
+> (sm <- simulate(nm, nsim=10))
+An object of class "simmat"
+"r00" method (binary, non-sequential)
+12 x 10 matrix
+Number of permuted matrices = 10 
+
+> 
+> ## sequential nullmodel
+> (nm <- nullmodel(x, "swap"))
+An object of class "nullmodel"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Iterations = 0 
+
+> (sm1 <- simulate(nm, nsim=10, thin=5))
+An object of class "simmat"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Number of permuted matrices = 10 
+Start = 1, End = 50, Thin = 5
+
+> (sm2 <- simulate(nm, nsim=10, thin=5))
+An object of class "simmat"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Number of permuted matrices = 10 
+Start = 51, End = 100, Thin = 5
+
+> 
+> ## sequential nullmodel with burnin and extra updating
+> (nm <- nullmodel(x, "swap"))
+An object of class "nullmodel"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Iterations = 0 
+
+> (sm1 <- simulate(nm, burnin=10, nsim=10, thin=5))
+An object of class "simmat"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Number of permuted matrices = 10 
+Start = 11, End = 60, Thin = 5
+
+> (sm2 <- simulate(nm, nsim=10, thin=5))
+An object of class "simmat"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Number of permuted matrices = 10 
+Start = 61, End = 110, Thin = 5
+
+> 
+> ## sequential nullmodel with separate initial burnin
+> (nm <- nullmodel(x, "swap"))
+An object of class "nullmodel"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Iterations = 0 
+
+> update(nm, nsim=10)
+> (sm2 <- simulate(nm, nsim=10, thin=5))
+An object of class "simmat"
+"swap" method (binary, sequential)
+12 x 10 matrix
+Number of permuted matrices = 10 
+Start = 11, End = 60, Thin = 5
+
+> 
+> 
+> 
+> cleanEx()
 > nameEx("oecosimu")
 > ### * oecosimu
 > 
@@ -4819,7 +5000,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106d76540>
+<environment: 0x106cb7ab0>
 
 Estimated degrees of freedom:
 6.4351  total = 7.435071 
@@ -4835,7 +5016,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x105526dc8>
+<environment: 0x105071788>
 
 Estimated degrees of freedom:
 6.1039  total = 7.103853 
@@ -4991,7 +5172,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106aa0b90>
+<environment: 0x106225ae0>
 
 Estimated degrees of freedom:
 8.9275  total = 9.927492 
@@ -5004,7 +5185,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106b79758>
+<environment: 0x1078e2f58>
 
 Estimated degrees of freedom:
 7.7529  total = 8.75294 
@@ -5017,7 +5198,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106d64b80>
+<environment: 0x107e70e00>
 
 Estimated degrees of freedom:
 8.8962  total = 9.89616 
@@ -7277,7 +7458,7 @@
 
 Formula:
 y ~ s(x1, x2, k = knots)
-<environment: 0x106f7e208>
+<environment: 0x107d87dc8>
 
 Estimated degrees of freedom:
 2  total = 3 
@@ -7753,7 +7934,7 @@
 > ### * <FOOTER>
 > ###
 > cat("Time elapsed: ", proc.time() - get("ptime", pos = 'CheckExEnv'),"\n")
-Time elapsed:  159.371 1.809 164.032 0 0 
+Time elapsed:  111.738 1.253 113.941 0 0 
 > grDevices::dev.off()
 null device 
           1 



More information about the Vegan-commits mailing list