[Vegan-commits] r705 - pkg/vegan/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Feb 24 20:17:54 CET 2009
Author: psolymos
Date: 2009-02-24 20:17:53 +0100 (Tue, 24 Feb 2009)
New Revision: 705
Modified:
pkg/vegan/R/lag.plot.permat.R
Log:
lag specified exactly to be 1 inside
Modified: pkg/vegan/R/lag.plot.permat.R
===================================================================
--- pkg/vegan/R/lag.plot.permat.R 2009-02-24 19:14:55 UTC (rev 704)
+++ pkg/vegan/R/lag.plot.permat.R 2009-02-24 19:17:53 UTC (rev 705)
@@ -1,33 +1,34 @@
`lag.plot.permat` <-
function(x, type = "bray", sub=NULL, ...)
{
+ lag <- 1
type <- match.arg(type, c("bray", "chisq"))
## this duality is required, because ylab can not be specified for lag.plot
switch(type,
"bray" = {
out <- Bray.Curtis.Dissimilarities <- summary(x)[[type]]
if (is.null(sub)) {
- Bt <- Box.test(out)[c(1,2,3)]
+ Bt <- Box.test(out, lag=lag)[c(1,2,3)]
names(Bt)[c(1,2)] <- c("X-squared", "df")
Bt[[1]] <- round(Bt[[1]], 3)
Bt[[3]] <- if (Bt[[3]] < 0.0001)
"< 0.0001" else round(Bt[[3]], 3)
sub <- paste("Box-Pierce test: ", paste(names(Bt), Bt, collapse=", "), collapse="")
}
- lag.plot(Bray.Curtis.Dissimilarities, sub=sub, ...)
+ lag.plot(Bray.Curtis.Dissimilarities, lag=lag, sub=sub, ...)
invisible(out)
},
"chisq" = {
out <- Chi.Squared.Values <- summary(x)[[type]]
if (is.null(sub)) {
- Bt <- Box.test(out)[c(1,2,3)]
+ Bt <- Box.test(out, lag=lag)[c(1,2,3)]
names(Bt)[c(1,2)] <- c("X-squared", "df")
Bt[[1]] <- round(Bt[[1]], 3)
Bt[[3]] <- if (Bt[[3]] < 0.0001)
"< 0.0001" else round(Bt[[3]], 3)
sub <- paste("Box-Pierce test: ", paste(names(Bt), Bt, collapse=", "), collapse="")
}
- lag.plot(Chi.Squared.Values, sub=sub, ...)
+ lag.plot(Chi.Squared.Values, lag=lag, sub=sub, ...)
invisible(out)
})
}
More information about the Vegan-commits
mailing list