[Analogue-commits] r317 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 22 17:19:58 CET 2013


Author: gsimpson
Date: 2013-03-22 17:19:58 +0100 (Fri, 22 Mar 2013)
New Revision: 317

Modified:
   pkg/R/fitted.timetrack.R
   pkg/R/scores.timetrack.R
   pkg/man/timetrack.Rd
Log:
minor improvements to fitted and scores methods for timetrack

Modified: pkg/R/fitted.timetrack.R
===================================================================
--- pkg/R/fitted.timetrack.R	2013-03-22 05:59:32 UTC (rev 316)
+++ pkg/R/fitted.timetrack.R	2013-03-22 16:19:58 UTC (rev 317)
@@ -13,6 +13,6 @@
     } else {
         fit <- fitted(object$ordination, model = model,
                       ...)[, choices, drop = FALSE]
-    }
+      }
     fit
 }

Modified: pkg/R/scores.timetrack.R
===================================================================
--- pkg/R/scores.timetrack.R	2013-03-22 05:59:32 UTC (rev 316)
+++ pkg/R/scores.timetrack.R	2013-03-22 16:19:58 UTC (rev 317)
@@ -1,11 +1,15 @@
-`scores.timetrack` <- function(x, which = c("passive","ordination"),
+`scores.timetrack` <- function(x, which = c("ordination","passive"),
                                scaling = x$scaling, choices = 1:2,
-                               ...) {
-  which <- match.arg(which)
-  scrs <- if(which == "passive") {
-    fitted(x, which = which, choices = choices, ...)
-  } else {
-    scores(x, ..., choices = choices, scaling = scaling)
-  }
-  scrs
+                               display = "sites", ...) {
+    which <- match.arg(which)
+    ## only scores available for passive are the fitted (predicted) WA
+    ## scores
+    scrs <- if(which == "passive") {
+        fitted(x, which = which, choices = choices, ...)
+    } else {
+        ## for the underlying ordination, take the usual scores
+        scores(x$ord, ..., choices = choices, scaling = scaling,
+               display = display)
+    }
+    scrs
 }

Modified: pkg/man/timetrack.Rd
===================================================================
--- pkg/man/timetrack.Rd	2013-03-22 05:59:32 UTC (rev 316)
+++ pkg/man/timetrack.Rd	2013-03-22 16:19:58 UTC (rev 317)
@@ -20,8 +20,8 @@
 \method{fitted}{timetrack}(object, which = c("passive", "ordination"),
        model = NULL, choices = 1:2, \dots)
 
-\method{scores}{timetrack}(x, which = c("passive", "ordination"),
-       scaling = x$scaling, choices = 1:2, \dots)
+\method{scores}{timetrack}(x, which = c("ordination", "passive"),
+       scaling = x$scaling, choices = 1:2, display = "sites", \dots)
 
 \method{plot}{timetrack}(x, choices = 1:2, display = c("wa", "lc"),
      order, ptype = c("l", "p", "o", "b"), pch = c(1,2),



More information about the Analogue-commits mailing list