[Vegan-commits] r2218 - in branches/2.0: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 14 11:39:26 CEST 2012
Author: jarioksa
Date: 2012-06-14 11:39:26 +0200 (Thu, 14 Jun 2012)
New Revision: 2218
Modified:
branches/2.0/R/plot.envfit.R
branches/2.0/inst/ChangeLog
branches/2.0/inst/NEWS.Rd
branches/2.0/man/envfit.Rd
Log:
merge r2115: plot.envfit gained 'bg' arg
Modified: branches/2.0/R/plot.envfit.R
===================================================================
--- branches/2.0/R/plot.envfit.R 2012-06-14 08:55:01 UTC (rev 2217)
+++ branches/2.0/R/plot.envfit.R 2012-06-14 09:39:26 UTC (rev 2218)
@@ -1,6 +1,6 @@
`plot.envfit` <-
function (x, choices = c(1, 2), arrow.mul, at = c(0, 0),
- axis = FALSE, p.max = NULL, col = "blue", add = TRUE, ...)
+ axis = FALSE, p.max = NULL, col = "blue", bg, add = TRUE, ...)
{
formals(arrows) <- c(formals(arrows), alist(... = ))
vect <- NULL
@@ -86,11 +86,20 @@
if (!is.null(vect)) {
arrows(at[1], at[2], vect[, 1], vect[, 2], len = 0.05,
col = col)
- text(vtext, rownames(x$vectors$arrows), col = col, ...)
+ if (missing(bg))
+ text(vtext, rownames(x$vectors$arrows), col = col, ...)
+ else
+ ordilabel(vtext, labels = rownames(x$vectors$arrows),
+ col = col, fill = bg, ...)
}
if (!is.null(x$factors)) {
- text(x$factors$centroids[, choices, drop = FALSE],
- rownames(x$factors$centroids), col = col, ...)
+ if (missing(bg))
+ text(x$factors$centroids[, choices, drop = FALSE],
+ rownames(x$factors$centroids), col = col, ...)
+ else
+ ordilabel(x$factors$centroids[, choices, drop = FALSE],
+ labels = rownames(x$factors$centroids),
+ col = col, fill = bg, ...)
}
if (axis && !is.null(vect)) {
axis(3, at = ax + at[1], labels = c(maxarr, 0, maxarr),
Modified: branches/2.0/inst/ChangeLog
===================================================================
--- branches/2.0/inst/ChangeLog 2012-06-14 08:55:01 UTC (rev 2217)
+++ branches/2.0/inst/ChangeLog 2012-06-14 09:39:26 UTC (rev 2218)
@@ -4,6 +4,8 @@
Version 2.0-4 (opened March 9, 2012)
+ * merge r2215: plot.envfit() gains args 'bg' for background colour
+ of labels.
* merge r2206,7: check 'newdata' dims in predict(..., type =
"response"|"working") for CA results.
* merge r2195-7, 2204: bias adjusted betadisper.
Modified: branches/2.0/inst/NEWS.Rd
===================================================================
--- branches/2.0/inst/NEWS.Rd 2012-06-14 08:55:01 UTC (rev 2217)
+++ branches/2.0/inst/NEWS.Rd 2012-06-14 09:39:26 UTC (rev 2218)
@@ -61,6 +61,10 @@
community data. This allows using other dissimilarities than
those available in \code{vegdist}.
+ \item \code{plot} function for \code{envfit} results gained new
+ argument \code{bg} that can be used to set background colour for
+ plotted labels.
+
\item \code{msoplot} is more configurable, and allows, for
instance, setting y-axis limits.
Modified: branches/2.0/man/envfit.Rd
===================================================================
--- branches/2.0/man/envfit.Rd 2012-06-14 08:55:01 UTC (rev 2217)
+++ branches/2.0/man/envfit.Rd 2012-06-14 09:39:26 UTC (rev 2218)
@@ -19,7 +19,7 @@
display = "sites", w = weights(ord), na.rm = FALSE, ...)
\method{envfit}{formula}(formula, data, ...)
\method{plot}{envfit}(x, choices = c(1,2), arrow.mul, at = c(0,0), axis = FALSE,
- p.max = NULL, col = "blue", add = TRUE, ...)
+ p.max = NULL, col = "blue", bg, add = TRUE, ...)
\method{scores}{envfit}(x, display, choices, ...)
vectorfit(X, P, permutations = 0, strata, w, ...)
factorfit(X, P, permutations = 0, strata, w, ...)
@@ -56,6 +56,9 @@
variables. You must calculate \eqn{P} values with setting
\code{permutations} to use this option. }
\item{col}{Colour in plotting.}
+ \item{bg}{Background colour for labels. If \code{bg} is set, the
+ labels are displayed with \code{\link{ordilabel}} instead of
+ \code{text}. See Examples for using semitransparent background.}
\item{add}{Results added to an existing ordination plot.}
\item{strata}{An integer vector or factor specifying the strata for
permutation. If supplied, observations are permuted only within the
@@ -195,7 +198,9 @@
fit <- envfit(ord, varechem, perm = 999, display = "lc")
plot(fit, p.max = 0.05, col = "red")
## Class variables, formula interface, and displaying the
-## inter-class variability with `ordispider'
+## inter-class variability with `ordispider', and semitransparent
+## white background for labels (semitransparent colours are not
+## supported by all graphics devices)
data(dune)
data(dune.env)
attach(dune.env)
@@ -204,7 +209,7 @@
plot(ord, type = "n")
ordispider(ord, Moisture, col="skyblue")
points(ord, display = "sites", col = as.numeric(Moisture), pch=16)
-plot(fit, cex=1.2, axis=TRUE)
+plot(fit, cex=1.2, axis=TRUE, bg = rgb(1, 1, 1, 0.5))
}
\keyword{multivariate }
\keyword{aplot}
More information about the Vegan-commits
mailing list