[Vegan-commits] r721 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 7 17:38:08 CET 2009


Author: psolymos
Date: 2009-03-07 17:38:08 +0100 (Sat, 07 Mar 2009)
New Revision: 721

Added:
   pkg/vegan/R/as.ts.permat.R
Removed:
   pkg/vegan/R/diagnose.R
   pkg/vegan/R/diagnose.permat.R
   pkg/vegan/R/lagplot.R
   pkg/vegan/R/lagplot.permat.R
Log:
remove hard coded methods for permat diagnostics, adding as.ts method


Added: pkg/vegan/R/as.ts.permat.R
===================================================================
--- pkg/vegan/R/as.ts.permat.R	                        (rev 0)
+++ pkg/vegan/R/as.ts.permat.R	2009-03-07 16:38:08 UTC (rev 721)
@@ -0,0 +1,11 @@
+`as.ts.permat` <-
+    function(x, type = "bray", ...)
+{
+    type <- match.arg(type, c("bray", "chisq"))
+    out <- summary(x)[[type]]
+    if (!is.ts(out)) {
+        seqmethods <- c("swap", "tswap", "abuswap")
+        stop("as.ts available only for sequential methods ",
+            paste(seqmethods, collapse=", "))
+    } else return(out)
+}

Deleted: pkg/vegan/R/diagnose.R
===================================================================
--- pkg/vegan/R/diagnose.R	2009-03-05 22:29:41 UTC (rev 720)
+++ pkg/vegan/R/diagnose.R	2009-03-07 16:38:08 UTC (rev 721)
@@ -1,5 +0,0 @@
-`diagnose` <-
-function (x, ...)
-{
-    UseMethod("diagnose")
-}

Deleted: pkg/vegan/R/diagnose.permat.R
===================================================================
--- pkg/vegan/R/diagnose.permat.R	2009-03-05 22:29:41 UTC (rev 720)
+++ pkg/vegan/R/diagnose.permat.R	2009-03-07 16:38:08 UTC (rev 721)
@@ -1,20 +0,0 @@
-diagnose.permat <-
-function(x, type = "bray", ...) {
-    tsVec <- summary(x)[[type]]
-    if (!is.ts(tsVec))
-        stop("'diagnose' method available only for sequential methods")
-    ARmod <- arima(tsVec, order = c(1, 0, 0))
-    ARmod$call <- match.call()
-    ARresid <- ARmod$residuals
-    BOX.tsVec <- Box.test(tsVec, lag = 1, type = "Ljung-Box")
-    BOX.tsVec$data.name <- switch(type,
-        "bray" = "Bray-Curtis dissimilarities",
-        "chisq" = "Chi-squared values")
-    BOX.ARresid <- Box.test(ARresid, lag = 1, type = "Ljung-Box")
-    BOX.ARresid$data.name <- "AR residuals"
-    x$perm <- NULL
-    out <- list(call=match.call(), x=x, ts=tsVec,
-        arima=ARmod, box.ts=BOX.tsVec, box.resid=BOX.ARresid)
-    class(out) <- "diagnose.permat"
-    out
-}

Deleted: pkg/vegan/R/lagplot.R
===================================================================
--- pkg/vegan/R/lagplot.R	2009-03-05 22:29:41 UTC (rev 720)
+++ pkg/vegan/R/lagplot.R	2009-03-07 16:38:08 UTC (rev 721)
@@ -1,5 +0,0 @@
-`lagplot` <-
-function (x, ...)
-{
-    UseMethod("lagplot")
-}

Deleted: pkg/vegan/R/lagplot.permat.R
===================================================================
--- pkg/vegan/R/lagplot.permat.R	2009-03-05 22:29:41 UTC (rev 720)
+++ pkg/vegan/R/lagplot.permat.R	2009-03-07 16:38:08 UTC (rev 721)
@@ -1,16 +0,0 @@
-`lagplot.permat` <-
-function(x, type = "bray", ...)
-{
-    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]]
-            lag.plot(Bray.Curtis.Dissimilarities, ...)
-        },
-        "chisq" = {
-            out <- Chi.Squared.Values <- summary(x)[[type]]
-            lag.plot(Chi.Squared.Values, ...)
-        })
-    invisible(out)
-}



More information about the Vegan-commits mailing list