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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Mar 27 15:06:10 CET 2008


Author: jarioksa
Date: 2008-03-27 15:06:10 +0100 (Thu, 27 Mar 2008)
New Revision: 290

Modified:
   pkg/R/screeplot.cca.R
   pkg/R/screeplot.decorana.R
   pkg/R/screeplot.prcomp.R
   pkg/R/screeplot.princomp.R
   pkg/inst/ChangeLog
   pkg/man/screeplot.cca.Rd
Log:
screeplot methods return invisibly xy.coords of x-coordinates and eigenvalues

Modified: pkg/R/screeplot.cca.R
===================================================================
--- pkg/R/screeplot.cca.R	2008-03-26 20:42:41 UTC (rev 289)
+++ pkg/R/screeplot.cca.R	2008-03-27 14:06:10 UTC (rev 290)
@@ -35,14 +35,11 @@
         axis(2)
         axis(1, at = comps, labels = names(eig.vals[comps]))
         box()
+        mids <- comps
     }
     if(bstick) {
-        if(type == "barplot")
-            lines(mids, ord.bstick[comps], type = ptype, col = bst.col,
-                  lty = bst.lty)
-        else
-            lines(ord.bstick[comps], type = ptype, col = bst.col,
-                  lty = bst.lty)
+        lines(mids, ord.bstick[comps], type = ptype, col = bst.col,
+              lty = bst.lty)
     }
-    invisible(x)
+    invisible(xy.coords(x = mids, y = eig.vals[comps]))
 }

Modified: pkg/R/screeplot.decorana.R
===================================================================
--- pkg/R/screeplot.decorana.R	2008-03-26 20:42:41 UTC (rev 289)
+++ pkg/R/screeplot.decorana.R	2008-03-27 14:06:10 UTC (rev 290)
@@ -18,7 +18,8 @@
              xlab = xlab, ylab = ylab, main = main, ...)
         axis(2)
         axis(1, at = comps, labels = names(eig.vals[comps]))
+        mids <- comps
         box()
     }
-    invisible(x)
+    invisible(xy.coords(x = mids, y = eig.vals[comps]))
 }

Modified: pkg/R/screeplot.prcomp.R
===================================================================
--- pkg/R/screeplot.prcomp.R	2008-03-26 20:42:41 UTC (rev 289)
+++ pkg/R/screeplot.prcomp.R	2008-03-27 14:06:10 UTC (rev 290)
@@ -29,15 +29,12 @@
              xlab = xlab, ylab = ylab, ...)
         axis(2)
         axis(1, at = comps, labels = names(eig.vals[comps]))
+        mids <-  comps
         box()
     }
     if(bstick) {
-        if(type == "barplot")
-            lines(mids, ord.bstick[comps], type = ptype, col = bst.col,
-                  lty = bst.lty)
-        else
-            lines(ord.bstick[comps], type = ptype, col = bst.col,
-                  lty = bst.lty)
+        lines(mids, ord.bstick[comps], type = ptype, col = bst.col,
+              lty = bst.lty)
     }
-    invisible(x)
+    invisible(xy.coords(x = mids, y = eig.vals[comps]))
 }

Modified: pkg/R/screeplot.princomp.R
===================================================================
--- pkg/R/screeplot.princomp.R	2008-03-26 20:42:41 UTC (rev 289)
+++ pkg/R/screeplot.princomp.R	2008-03-27 14:06:10 UTC (rev 290)
@@ -29,15 +29,12 @@
              xlab = xlab, ylab = ylab, ...)
         axis(2)
         axis(1, at = comps, labels = names(eig.vals[comps]))
+        mids <- comps
         box()
     }
     if(bstick) {
-        if(type == "barplot")
-            lines(mids, ord.bstick[comps], type = ptype, col = bst.col,
-                  lty = bst.lty)
-        else
-            lines(ord.bstick[comps], type = ptype, col = bst.col,
-                  lty = bst.lty)
+        lines(mids, ord.bstick[comps], type = ptype, col = bst.col,
+              lty = bst.lty)
     }
-    invisible(x)
+    invisible(xy.coords(x = mids, y = eig.vals[comps]))
 }

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2008-03-26 20:42:41 UTC (rev 289)
+++ pkg/inst/ChangeLog	2008-03-27 14:06:10 UTC (rev 290)
@@ -4,6 +4,16 @@
 
 Version 1.12-7 (opened Mar 25, 2008)
 
+	* screeplot: functions return now invisibly the xy.coords of
+	bars or points for eigenvalues. They used to return
+	invisibly the input data ('x'). Concerns screeplot methods for
+	'decorana', 'cca', 'princomp' and 'prcomp' objects in vegan.
+	
+	* varpart4: result could be wrong if 'varpart' was bypassed and
+	'varpart4' was called directly, because 'Y' was not centred before
+	calculating sum of squares in 'varpart4' ('varpart2' and
+	'varpart3' were OK). Reported by Guillaume Blanchet, Uni Alberta.
+	
 	* permutest: Now a generic function. permutest.cca is now the
 	'cca' method.
 

Modified: pkg/man/screeplot.cca.Rd
===================================================================
--- pkg/man/screeplot.cca.Rd	2008-03-26 20:42:41 UTC (rev 289)
+++ pkg/man/screeplot.cca.Rd	2008-03-27 14:06:10 UTC (rev 290)
@@ -100,9 +100,12 @@
   additive in detrended analysis.
   }
 \value{
-  For \code{screeplot}, a plot on the currently active device.
+  Function \code{screeplot} draws a plot on the currently active device, 
+  and returns invisibly the \code{\link{xy.coords}} of the points or
+  bars for the eigenvalues.
 
-  For \code{bstick}, a numeric vector of broken stick components.
+  Function \code{bstick} returns a numeric vector of broken stick
+  components. 
 }
 \references{
   Jackson, D. A. (1993). Stopping rules in principal components



More information about the Vegan-commits mailing list