[Vegan-commits] r426 - in pkg: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 16 10:17:36 CEST 2008


Author: jarioksa
Date: 2008-06-16 10:17:36 +0200 (Mon, 16 Jun 2008)
New Revision: 426

Modified:
   pkg/R/plot.cca.R
   pkg/R/scores.rda.R
   pkg/inst/ChangeLog
   pkg/man/plot.cca.Rd
Log:
scores.rda gained argument 'const' to set the general scaling constant

Modified: pkg/R/plot.cca.R
===================================================================
--- pkg/R/plot.cca.R	2008-06-16 04:28:14 UTC (rev 425)
+++ pkg/R/plot.cca.R	2008-06-16 08:17:36 UTC (rev 426)
@@ -1,9 +1,9 @@
 `plot.cca` <-
     function (x, choices = c(1, 2), display = c("sp", "wa", "cn"), 
-              scaling = 2, type, xlim, ylim,  ...) 
+              scaling = 2, type, xlim, ylim,  const, ...) 
 {
     TYPES <- c("text", "points", "none")
-    g <- scores(x, choices, display, scaling)
+    g <- scores(x, choices, display, scaling, const)
     if (!is.list(g)) 
         g <- list(default = g)
     if (!is.null(g$centroids)) {
@@ -83,4 +83,3 @@
     class(g) <- "ordiplot"
     invisible(g)
 }
-

Modified: pkg/R/scores.rda.R
===================================================================
--- pkg/R/scores.rda.R	2008-06-16 04:28:14 UTC (rev 425)
+++ pkg/R/scores.rda.R	2008-06-16 08:17:36 UTC (rev 426)
@@ -1,6 +1,6 @@
 "scores.rda" <-
     function (x, choices = c(1, 2), display = c("sp", "wa", "cn"), 
-              scaling = 2, ...) 
+              scaling = 2, const, ...) 
 {
     tabula <- c("species", "sites", "constraints", "biplot", 
                 "centroids")
@@ -21,7 +21,8 @@
         nrow(x$CA$u)
     else
         nrow(x$CCA$u)
-    const <- sqrt(sqrt((nr-1) * sumev))
+    if (missing(const))
+        const <- sqrt(sqrt((nr-1) * sumev))
     rnk <- x$CCA$rank
     sol <- list()
     if ("species" %in% take) {
@@ -82,4 +83,3 @@
         sol <- sol[[1]]
     return(sol)
 }
-

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2008-06-16 04:28:14 UTC (rev 425)
+++ pkg/inst/ChangeLog	2008-06-16 08:17:36 UTC (rev 426)
@@ -6,7 +6,10 @@
 
 	* scores.rda: scaling = 0 returns now unmodified scores from the
 	object (like documented) without multiplying by the scaling
-	constant. 
+	constant. Gains argument 'const' for user-settable general scaling
+	constant of the scores. The default 'const' is found internally to
+	giv a biplot scaling so that species and site scores together
+	approximate the original data.
 	
 Version 1.14-4 (closed June 12, 2008)
 

Modified: pkg/man/plot.cca.Rd
===================================================================
--- pkg/man/plot.cca.Rd	2008-06-16 04:28:14 UTC (rev 425)
+++ pkg/man/plot.cca.Rd	2008-06-16 08:17:36 UTC (rev 426)
@@ -17,12 +17,14 @@
 }
 \usage{
 \method{plot}{cca}(x, choices = c(1, 2), display = c("sp", "wa", "cn"),
-         scaling = 2, type, xlim, ylim, ...)
+         scaling = 2, type, xlim, ylim, const, ...)
 \method{text}{cca}(x, display = "sites", labels, choices = c(1, 2), scaling = 2,
     arrow.mul, head.arrow = 0.05, select, ...)
 \method{points}{cca}(x, display = "sites", choices = c(1, 2), scaling = 2,
     arrow.mul, head.arrow = 0.05, select, ...)
-\method{scores}{cca}(x, choices=c(1,2), display=c("sp","wa","cn"),scaling=2, ...)
+\method{scores}{cca}(x, choices=c(1,2), display=c("sp","wa","cn"), scaling=2, ...)
+\method{scores}{rda}(x, choices=c(1,2), display=c("sp","wa","cn"), scaling=2, 
+    const, ...)
 \method{summary}{cca}(object, scaling = 2, axes = 6, display = c("sp", "wa", 
     "lc", "bp", "cn"), digits = max(3, getOption("digits") - 3), ...)
 \method{print}{summary.cca}(x, digits = x$digits, head = NA, tail = head, ...)
@@ -62,6 +64,9 @@
   \item{select}{Items to be displayed.  This can either be a logical
     vector which is \code{TRUE} for displayed items or a vector of indices
     of displayed items.}
+  \item{const}{General scaling constant to \code{rda} scores. The
+    default is to use constant to give biplot scores, or scores that
+    approximate original data.}
   \item{axes}{Number of axes in summaries.}
   \item{digits}{Number of digits in output.}
   \item{head, tail}{Number of rows printed from the head and tail of



More information about the Vegan-commits mailing list