Skip to content

Commit

Permalink
Merge branch 'plot-metaMDS-cex'
Browse files Browse the repository at this point in the history
  • Loading branch information
jarioksa committed Aug 8, 2024
2 parents 71f2360 + d04cc50 commit 2401d97
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
6 changes: 4 additions & 2 deletions R/ordiplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
ylim <- tmp[, 2]
plot(tmp, xlim = xlim, ylim = ylim, asp = 1, type = "n",
...)
## default cex = 0.7 if not defined by the user
if (is.null(match.call(expand.dots = FALSE)$...$cex)) {
## default cex = 0.7 if not defined by the user, but if had
## optimize=TRUE, ordipointlabel is called with cex=0.7 which
## with par(cex) becomes cex=0.49
if (is.null(match.call(expand.dots = FALSE)$...$cex) && !optimize) {
op <- par(cex = 0.7)
on.exit(par(op))
}
Expand Down
6 changes: 3 additions & 3 deletions R/points.metaMDS.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"points.metaMDS" <-
`points.metaMDS` <-
function (x, display = c("sites", "species"),
choices = c(1, 2), shrink = FALSE, select, ...)
choices = c(1, 2), shrink = FALSE, select, cex = 0.7, ...)
{
display <- match.arg(display)
x <- scores(x, display = display, choices = choices, shrink = shrink)
if (!missing(select))
x <- .checkSelect(select, x)
points(x, ...)
points(x, cex = cex, ...)
invisible()
}
4 changes: 2 additions & 2 deletions R/print.monoMDS.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
x <- scores(x, choices = choices)
if (!missing(select))
x <- .checkSelect(select, x)
points(x, ...)
points (x, ...)
invisible()
}

Expand All @@ -74,7 +74,7 @@
rownames(x) <- labels
if (!missing(select))
x <- .checkSelect(select, x)
text(x, labels = rownames(x), ...)
text.ordiplot(x, what = "sites", labels = rownames(x), ...)
invisible()
}

6 changes: 3 additions & 3 deletions R/text.metaMDS.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"text.metaMDS" <-
`text.metaMDS` <-
function (x, display = c("sites", "species"), labels,
choices = c(1, 2), shrink = FALSE, select, ...)
choices = c(1, 2), shrink = FALSE, select, cex = 0.7, ...)
{
display <- match.arg(display)
x <- scores(x, display = display, choices = choices, shrink = shrink)
if (!missing(labels))
rownames(x) <- labels
if (!missing(select))
x <- .checkSelect(select, x)
text(x, labels = rownames(x), ...)
text.ordiplot(x, what = display, labels = rownames(x), cex = cex, ...)
invisible()
}
7 changes: 4 additions & 3 deletions man/metaMDS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ metaMDS(comm, distance = "bray", k = 2, try = 20, trymax = 20,
noshare = (engine == "isoMDS"), wascores = TRUE, expand = TRUE,
trace = 1, plot = FALSE, previous.best, ...)
\method{plot}{metaMDS}(x, display = c("sites", "species"), choices = c(1, 2),
type = "p", shrink = FALSE, ...)
type = "p", shrink = FALSE, cex = 0.7, ...)
\method{points}{metaMDS}(x, display = c("sites", "species"),
choices = c(1,2), shrink = FALSE, select, ...)
choices = c(1,2), shrink = FALSE, select, cex = 0.7, ...)
\method{text}{metaMDS}(x, display = c("sites", "species"), labels,
choices = c(1,2), shrink = FALSE, select, ...)
choices = c(1,2), shrink = FALSE, select, cex = 0.7, ...)
\method{scores}{metaMDS}(x, display = c("sites", "species"), shrink = FALSE,
choices, tidy = FALSE, ...)
metaMDSdist(comm, distance = "bray", autotransform = TRUE,
Expand Down Expand Up @@ -104,6 +104,7 @@ metaMDSredist(object, ...)
\item{display}{Display \code{"sites"} or \code{"species"}.}
\item{shrink}{Shrink back species scores if they were expanded
originally.}
\item{cex}{Character expansion for plotting symbols.}
\item{tidy}{Return scores that are compatible with \CRANpkg{ggplot2}:
all scores are in a single \code{data.frame}, score type is
identified by factor variable \code{code} (\code{"sites"} or
Expand Down
2 changes: 1 addition & 1 deletion man/vegan-internal.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ordiTerminfo(d, data)
ordiNAexclude(x, excluded)
ordiNApredict(omit, x)
ordiArgAbsorber(..., shrink, origin, scaling, triangular,
display, choices, const, truemean, optimize, FUN)
display, choices, const, truemean, optimize, arrows, FUN)
centroids.cca(x, mf, wt)
getPermuteMatrix(perm, N, strata = NULL)
howHead(x, ...)
Expand Down

0 comments on commit 2401d97

Please sign in to comment.