[Vegan-commits] r1875 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Sep 22 23:08:50 CEST 2011
Author: psolymos
Date: 2011-09-22 23:08:49 +0200 (Thu, 22 Sep 2011)
New Revision: 1875
Modified:
pkg/vegan/R/nullmodel.R
pkg/vegan/R/print.summary.permat.R
Log:
double also needs attention when input is integer
Modified: pkg/vegan/R/nullmodel.R
===================================================================
--- pkg/vegan/R/nullmodel.R 2011-09-22 17:18:01 UTC (rev 1874)
+++ pkg/vegan/R/nullmodel.R 2011-09-22 21:08:49 UTC (rev 1875)
@@ -19,10 +19,9 @@
int <- method$mode == "integer"
if (int && abs(sum(x) - sum(as.integer(x))) > 10^-6)
stop("non integer values not allowed")
- if (int) {
+ if (int)
x <- round(x, 0) # round up to closest integer
- storage.mode(x) <- "integer"
- }
+ storage.mode(x) <- method$mode
out <- list(
data=x,
nrow=as.integer(dim(x)[1L]),
@@ -37,7 +36,7 @@
state=if (method$isSeq) x else NULL,
iter=if (method$isSeq) as.integer(0L) else NULL
)
- storage.mode(out$x) <- method$mode
+# storage.mode(out$x) <- method$mode
storage.mode(out$rowSums) <- method$mode
storage.mode(out$colSums) <- method$mode
out <- list2env(out, parent=emptyenv())
Modified: pkg/vegan/R/print.summary.permat.R
===================================================================
--- pkg/vegan/R/print.summary.permat.R 2011-09-22 17:18:01 UTC (rev 1874)
+++ pkg/vegan/R/print.summary.permat.R 2011-09-22 21:08:49 UTC (rev 1875)
@@ -34,7 +34,7 @@
cat("\nSums within strata retained:", round(100 * sum(x$strsum) / n, digits), "%")
cat("\n\nBray-Curtis dissimilarities among original and permuted matrices:\n")
print(summary(x$bray))
- cat("\nChi-squared for original matrix: ", round(attr(x$chisq, "chisq.orig"), digits), ")\n", sep = "")
+ cat("\nChi-squared for original matrix: ", round(attr(x$chisq, "chisq.orig"), digits), "\n", sep = "")
cat("Chi-squared values among expected and permuted matrices:\n")
print(summary(x$chisq))
invisible(x)
More information about the Vegan-commits
mailing list