[Vegan-commits] r2328 - in pkg/vegan: R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 15 17:37:37 CEST 2012


Author: psolymos
Date: 2012-10-15 17:37:37 +0200 (Mon, 15 Oct 2012)
New Revision: 2328

Modified:
   pkg/vegan/R/msoplot.R
   pkg/vegan/inst/ChangeLog
   pkg/vegan/man/mso.Rd
Log:
legend arg for msoplot

Modified: pkg/vegan/R/msoplot.R
===================================================================
--- pkg/vegan/R/msoplot.R	2012-10-14 14:57:04 UTC (rev 2327)
+++ pkg/vegan/R/msoplot.R	2012-10-15 15:37:37 UTC (rev 2328)
@@ -1,5 +1,6 @@
 `msoplot` <-
-    function (x, alpha = 0.05, explained = FALSE, ylim = NULL, ...) 
+    function (x, alpha = 0.05, explained = FALSE, ylim = NULL, 
+    legend = "topleft", ...) 
 {
     object.cca <- x
     if (is.data.frame(object.cca$vario)) {
@@ -34,7 +35,7 @@
             lines(vario$Dist, vario$Sum, type = "b", lty = 2, 
                   pch = 3, ...)
             ## Legend
-            legend("topleft", c(label[c(2,3:b)+3], ci.lab, sign.lab),
+            legend(legend, c(label[c(2,3:b)+3], ci.lab, sign.lab),
                    lty=c(c(1,2,1,1,1)[2:b], 1, if(hasSig) NA),
                    pch=c(3, (6:(b+3))-6, NA, if(hasSig) 15)
                    )
@@ -54,7 +55,7 @@
             text(x = c(vario$Dist), y = par("usr")[3], pos = 3, 
                  label = c(vario$n), cex = 0.8)
             abline(v = max(object$H)/2, lty = 3, ...)
-            legend("topleft",
+            legend(legend,
                    c("Total variance","Global variance estimate",
                      if(hasSig) "Sign. autocorrelation"),
                    lty=c(1,5, if(hasSig) NA),

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2012-10-14 14:57:04 UTC (rev 2327)
+++ pkg/vegan/inst/ChangeLog	2012-10-15 15:37:37 UTC (rev 2328)
@@ -18,6 +18,9 @@
 	original axes in a wrong angle. The problem was reported by
 	Elizabeth Ottesen (MIT).
 
+	* msoplot: gained legend argument for positioning the legend
+	according to user needs.
+
 Version 2.1-20 (closed October 8, 2012)
 
 	* anova.cca: Dr Sven Neulinger (Christian Albrecht University,

Modified: pkg/vegan/man/mso.Rd
===================================================================
--- pkg/vegan/man/mso.Rd	2012-10-14 14:57:04 UTC (rev 2327)
+++ pkg/vegan/man/mso.Rd	2012-10-15 15:37:37 UTC (rev 2328)
@@ -14,7 +14,7 @@
 
 \usage{
 mso(object.cca, object.xy, grain = 1, round.up = FALSE, permutations = FALSE)
-msoplot(x, alpha = 0.05, explained = FALSE, ylim = NULL, ...)
+msoplot(x, alpha = 0.05, explained = FALSE, ylim = NULL, legend = "topleft", ...)
 }
 \arguments{
   \item{object.cca}{ An object of class cca, created by the \code{\link{cca}} or
@@ -40,6 +40,9 @@
   \item{explained}{ If false, suppresses the plotting of the variogram
     of explained variance.}
   \item{ylim}{Limits for y-axis.}
+  \item{legend}{The x and y co-ordinates to be used to position the legend. 
+    They can be specified by keyword or in any way which is accepted 
+    by \code{\link{legend}}.}
   \item{\dots}{Other arguments passed to functions.}
 }
 \details{



More information about the Vegan-commits mailing list