[Vegan-commits] r2905 - in pkg/vegan: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Oct 29 09:36:32 CET 2014
Author: jarioksa
Date: 2014-10-29 09:36:32 +0100 (Wed, 29 Oct 2014)
New Revision: 2905
Modified:
pkg/vegan/R/make.commsim.R
pkg/vegan/man/adipart.Rd
pkg/vegan/man/adonis.Rd
pkg/vegan/man/anosim.Rd
pkg/vegan/man/bioenv.Rd
pkg/vegan/man/clamtest.Rd
pkg/vegan/man/commsim.Rd
pkg/vegan/man/mantel.Rd
pkg/vegan/man/metaMDS.Rd
pkg/vegan/man/mrpp.Rd
pkg/vegan/man/multipart.Rd
pkg/vegan/man/oecosimu.Rd
pkg/vegan/man/ordisurf.Rd
pkg/vegan/man/permatfull.Rd
pkg/vegan/man/simper.Rd
Log:
Squashed commit of the following:
commit 6819b9dc3d8be4a57dc90a353a116dcaf730b9bb
Merge: a15feb5 4855881
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Wed Oct 29 10:04:10 2014 +0200
Merge pull request #65 from jarioksa/dollar-and-data-usage
Dollar and data usage
commit a15feb54164ea48042d6a7f8582701979376d56f
Merge: bb4b8bd 5af6b9d
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Wed Oct 29 10:03:21 2014 +0200
Merge pull request #63 from jarioksa/swsh-samp-works-with-double
swsh_samp null models can be used with non-integer quantities
commit 5af6b9d26fd220d1ec314a8de40336fd32939478
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 18:21:04 2014 +0200
Further clarification of swsh methods, like suggested by Peter Solymos
commit 485588172ea06f402b84f0e0b705845e49aeb082
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 16:07:33 2014 +0200
clean up edits
commit 1027a101b7f77c3dfaac8fe55910019b2400b8f5
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 15:56:04 2014 +0200
ordisurf has formula & data=, it does not need with()
commit f4543bed4c83603fc6fe6e608c4ec1cd44485ac9
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 15:44:43 2014 +0200
Use residuals(x) instead of x$residuals in permatfull examples
commit 5d51dc282c4d7932374c9b144ff104ef184f0b87
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 15:42:02 2014 +0200
Remove dollars from mrpp and multipart examples
commit def279b08ed4aa1233674d6ec68a0b6db2dd8a9c
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 15:35:06 2014 +0200
Remove $ from clamtest example
commit 4ba8c7e6116daec96ba7efa826bf8c67dcba6e76
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 15:29:44 2014 +0200
Avoid some $ signs in adonis examples
commit a1eaa183e10ea54f2644484d934855e43a2d7581
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 15:25:41 2014 +0200
Avoid $ with data frame, and force asp=1 in plotting maps of points
commit 78bf998d0d9e1033e791dc2efb0382761005b3b5
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Tue Oct 28 14:35:16 2014 +0200
swsh_samp null models can be used with non-integer quantities
swsh_samp, swsh_samp_c and swsh_samp_r null models shuffle original
cell values and can also be used with non-integer data. They were
unnecessarily restricted to integers. The swsh_both models
redistribute individuals among non-zero cells and can only be used
with integer values.
commit bb4b8bd0df28072e3aeb39be4521f717e06468ee
Author: Jari Oksanen <jari.oksanen at oulu.fi>
Date: Mon Oct 27 11:05:54 2014 +0200
remove refs to R 2.14.0 in man/: we depend on later version of R
Modified: pkg/vegan/R/make.commsim.R
===================================================================
--- pkg/vegan/R/make.commsim.R 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/R/make.commsim.R 2014-10-29 08:36:32 UTC (rev 2905)
@@ -183,14 +183,14 @@
out
}),
"swsh_samp" = commsim(method="swsh_samp", binary=FALSE, isSeq=FALSE,
- mode="integer",
+ mode="double",
fun=function(x, n, nr, nc, cs, rs, rf, cf, s, fill, thin) {
- nz <- as.integer(x[x > 0])
+ nz <- x[x > 0]
out <- array(unlist(r2dtable(fill, rf, cf)), c(nr, nc, n))
- storage.mode(out) <- "integer"
+ storage.mode(out) <- "double"
for (k in seq_len(n)) {
out[,,k] <- .C("quasiswap",
- m = out[,,k], nr, nc, PACKAGE = "vegan")$m
+ m = as.integer(out[,,k]), nr, nc, PACKAGE = "vegan")$m
out[,,k][out[,,k] > 0] <- sample(nz) # we assume that length(nz)>1
}
out
@@ -212,16 +212,16 @@
out
}),
"swsh_samp_r" = commsim(method="swsh_samp_r", binary=FALSE, isSeq=FALSE,
- mode="integer",
+ mode="double",
fun=function(x, n, nr, nc, cs, rs, rf, cf, s, fill, thin) {
out <- array(unlist(r2dtable(fill, rf, cf)), c(nr, nc, n))
- storage.mode(out) <- "integer"
+ storage.mode(out) <- "double"
I <- seq_len(nr)
for (k in seq_len(n)) {
out[,,k] <- .C("quasiswap",
- m = out[,,k], nr, nc, PACKAGE = "vegan")$m
+ m = as.integer(out[,,k]), nr, nc, PACKAGE = "vegan")$m
for (i in I) {
- nz <- as.integer(x[i,][x[i,] > 0])
+ nz <- x[i,][x[i,] > 0]
if (length(nz) == 1)
out[i,,k][out[i,,k] > 0] <- nz
if (length(nz) > 1)
@@ -231,16 +231,16 @@
out
}),
"swsh_samp_c" = commsim(method="swsh_samp_c", binary=FALSE, isSeq=FALSE,
- mode="integer",
+ mode="double",
fun=function(x, n, nr, nc, cs, rs, rf, cf, s, fill, thin) {
out <- array(unlist(r2dtable(fill, rf, cf)), c(nr, nc, n))
- storage.mode(out) <- "integer"
+ storage.mode(out) <- "double"
J <- seq_len(nc)
for (k in seq_len(n)) {
out[,,k] <- .C("quasiswap",
- m = out[,,k], nr, nc, PACKAGE = "vegan")$m
+ m = as.integer(out[,,k]), nr, nc, PACKAGE = "vegan")$m
for (j in J) {
- nz <- as.integer(x[,j][x[,j] > 0])
+ nz <- x[,j][x[,j] > 0]
if (length(nz) == 1)
out[,j,k][out[,j,k] > 0] <- nz
if (length(nz) > 1)
Modified: pkg/vegan/man/adipart.Rd
===================================================================
--- pkg/vegan/man/adipart.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/adipart.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -162,16 +162,16 @@
out[which(x > cut[i] & x <= cut[(i + 1)])] <- i
return(out)}
## The hierarchy of sample aggregation
-levsm <- data.frame(
+levsm <- with(mite.xy, data.frame(
l1=1:nrow(mite),
- l2=cutter(mite.xy$y, cut = seq(0, 10, by = 2.5)),
- l3=cutter(mite.xy$y, cut = seq(0, 10, by = 5)),
- l4=cutter(mite.xy$y, cut = seq(0, 10, by = 10)))
+ l2=cutter(y, cut = seq(0, 10, by = 2.5)),
+ l3=cutter(y, cut = seq(0, 10, by = 5)),
+ l4=cutter(y, cut = seq(0, 10, by = 10))))
## Let's see in a map
par(mfrow=c(1,3))
-plot(mite.xy, main="l1", col=as.numeric(levsm$l1)+1)
-plot(mite.xy, main="l2", col=as.numeric(levsm$l2)+1)
-plot(mite.xy, main="l3", col=as.numeric(levsm$l3)+1)
+plot(mite.xy, main="l1", col=as.numeric(levsm$l1)+1, asp = 1)
+plot(mite.xy, main="l2", col=as.numeric(levsm$l2)+1, asp = 1)
+plot(mite.xy, main="l3", col=as.numeric(levsm$l3)+1, asp = 1)
par(mfrow=c(1,1))
## Additive diversity partitioning
adipart(mite, index="richness", nsimul=19)
Modified: pkg/vegan/man/adonis.Rd
===================================================================
--- pkg/vegan/man/adonis.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/adonis.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -38,7 +38,7 @@
\item{parallel}{Number of parallel processes or a predefined socket
cluster. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later.}
+ package.}
\item{\dots}{Other arguments passed to \code{vegdist}.}
}
@@ -211,10 +211,10 @@
mod <- metaMDS(Y)
plot(mod)
### Hulls show treatment
-ordihull(mod, group=dat$NO3, show="0")
-ordihull(mod, group=dat$NO3, show="10", col=3)
+with(dat, ordihull(mod, group=NO3, show="0"))
+with(dat, ordihull(mod, group=NO3, show="10", col=3))
### Spider shows fields
-ordispider(mod, group=dat$field, lty=3, col="red")
+with(dat, ordispider(mod, group=field, lty=3, col="red"))
### Correct hypothesis test (with strata)
adonis(Y ~ NO3, data=dat, strata=dat$field, perm=999)
Modified: pkg/vegan/man/anosim.Rd
===================================================================
--- pkg/vegan/man/anosim.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/anosim.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -33,7 +33,7 @@
\item{parallel}{Number of parallel processes or a predefined socket
cluster. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later.}
+ package.}
}
\details{
Analysis of similarities (ANOSIM) provides a way to test statistically
Modified: pkg/vegan/man/bioenv.Rd
===================================================================
--- pkg/vegan/man/bioenv.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/bioenv.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -38,7 +38,7 @@
\item{parallel}{Number of parallel processes or a predefined socket
cluster. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later.}
+ package.}
\item{x}{\code{bioenv} result object.}
\item{which}{The number of the model for which the environmental
distances are evaluated, or the \code{"best"} model.}
Modified: pkg/vegan/man/clamtest.Rd
===================================================================
--- pkg/vegan/man/clamtest.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/clamtest.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -143,7 +143,7 @@
\examples{
data(mite)
data(mite.env)
-sol <- clamtest(mite, mite.env$Shrub=="None", alpha=0.005)
+sol <- with(mite.env, clamtest(mite, Shrub=="None", alpha=0.005))
summary(sol)
head(sol)
plot(sol)
Modified: pkg/vegan/man/commsim.Rd
===================================================================
--- pkg/vegan/man/commsim.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/commsim.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -224,29 +224,34 @@
\section{Quantitative Swap and Shuffle Models}{
- Quantitative Swap and Shuffle methods (\code{swhs} methods) preserve
+ Quantitative Swap and Shuffle methods (\code{swsh} methods) preserve
fill and column and row frequencies, and also either row or column
sums. The methods first perform a binary \code{quasiswap} and then
- shuffle original count data to non-zero cells. The \code{samp} methods
- shuffle original non-zero cell values, and \code{both} methods
- redistribute individuals randomly among non-zero cells. The shuffling
- is either free over the whole matrix, or within rows (\code{r} methods)
- or within columns (\code{c} methods). Shuffling within a row preserves
- row sums, and shuffling within a column preserves column sums.
+ shuffle original quantitative data to non-zero cells. The
+ \code{samp} methods shuffle original non-zero cell values and can be
+ used also with non-integer data. The \code{both} methods
+ redistribute individuals randomly among non-zero cells and can only
+ be used with integer data. The shuffling is either free over the
+ whole matrix, or within rows (\code{r} methods) or within columns
+ (\code{c} methods). Shuffling within a row preserves row sums, and
+ shuffling within a column preserves column sums.
-\itemize{
- \item{\code{"swsh_samp"}: }{non-sequential algorithm for count matrices.
+\itemize{
+
+ \item{\code{"swsh_samp"}: }{non-sequential algorithm for
+ quantitative data (either integer counts or non-integer values).
Original non-zero values values are shuffled.}
- \item{\code{"swsh_both"}: }{non-sequential algorithm for count matrices.
+ \item{\code{"swsh_both"}: }{non-sequential algorithm for count data.
Individuals are shuffled freely over non-zero cells.}
- \item{\code{"swsh_samp_r"}: }{non-sequential algorithm for count matrices.
- Non-zero values (samples) are shuffled separately for each row.}
+ \item{\code{"swsh_samp_r"}: }{non-sequential algorithm for
+ quantitative data. Non-zero values (samples) are shuffled
+ separately for each row.}
- \item{\code{"swsh_samp_c"}: }{non-sequential algorithm for count
- matrices. Non-zero values (samples) are shuffled separately for
- each column.}
+ \item{\code{"swsh_samp_c"}: }{non-sequential algorithm for
+ quantitative data. Non-zero values (samples) are shuffled
+ separately for each column.}
\item{\code{"swsh_both_r"}: }{non-sequential algorithm for count matrices.
Individuals are shuffled freely for non-zero values within each row.}
Modified: pkg/vegan/man/mantel.Rd
===================================================================
--- pkg/vegan/man/mantel.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/mantel.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -37,7 +37,7 @@
\item{parallel}{Number of parallel processes or a predefined socket
cluster. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later.}
+ package.}
}
\details{
Modified: pkg/vegan/man/metaMDS.Rd
===================================================================
--- pkg/vegan/man/metaMDS.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/metaMDS.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -131,7 +131,7 @@
library(vegan))} to make available internal \pkg{vegan}
functions. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later.}
+ package.}
\item{dist}{Dissimilarity matrix used in multidimensional scaling. }
\item{pc}{Rotate to principal components. }
Modified: pkg/vegan/man/mrpp.Rd
===================================================================
--- pkg/vegan/man/mrpp.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/mrpp.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -41,7 +41,7 @@
\item{parallel}{Number of parallel processes or a predefined socket
cluster. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later.}
+ package.}
\item{dist}{A \code{\link{dist}} object of dissimilarities, such as
produced by functions \code{\link{dist}}, \code{\link{vegdist}} or
\code{\link{designdist}}.}.
@@ -190,7 +190,7 @@
\examples{
data(dune)
data(dune.env)
-dune.mrpp <- mrpp(dune, dune.env$Management)
+dune.mrpp <- with(dune.env, mrpp(dune, Management))
dune.mrpp
# Save and change plotting parameters
@@ -198,7 +198,7 @@
layout(matrix(1:2,nr=1))
plot(dune.ord <- metaMDS(dune), type="text", display="sites" )
-ordihull(dune.ord, dune.env$Management)
+with(dune.env, ordihull(dune.ord, Management))
with(dune.mrpp, {
fig.dist <- hist(boot.deltas, xlim=range(c(delta,boot.deltas)),
Modified: pkg/vegan/man/multipart.Rd
===================================================================
--- pkg/vegan/man/multipart.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/multipart.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -105,11 +105,11 @@
out[which(x > cut[i] & x <= cut[(i + 1)])] <- i
return(out)}
## The hierarchy of sample aggregation
-levsm <- data.frame(
+levsm <- with(mite.xy, data.frame(
l1=1:nrow(mite),
- l2=cutter(mite.xy$y, cut = seq(0, 10, by = 2.5)),
- l3=cutter(mite.xy$y, cut = seq(0, 10, by = 5)),
- l4=cutter(mite.xy$y, cut = seq(0, 10, by = 10)))
+ l2=cutter(y, cut = seq(0, 10, by = 2.5)),
+ l3=cutter(y, cut = seq(0, 10, by = 5)),
+ l4=cutter(y, cut = seq(0, 10, by = 10))))
## Multiplicative diversity partitioning
multipart(mite, levsm, index="renyi", scales=1, nsimul=19)
multipart(mite ~ ., levsm, index="renyi", scales=1, nsimul=19)
Modified: pkg/vegan/man/oecosimu.Rd
===================================================================
--- pkg/vegan/man/oecosimu.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/oecosimu.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -78,10 +78,9 @@
\item{parallel}{Number of parallel processes or a predefined socket
cluster. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later. If you
- define a \code{nestfun} in Windows that needs other \R packages
- than \pkg{vegan} or \pkg{permute}, you must set up a socket
- cluster before the call. See \code{\link{vegandocs}}
+ package. If you define a \code{nestfun} in Windows that needs other
+ \R packages than \pkg{vegan} or \pkg{permute}, you must set up a
+ socket cluster before the call. See \code{\link{vegandocs}}
\code{decision-vegan} for details. }
\item{x}{An \code{oecosimu} result object.}
Modified: pkg/vegan/man/ordisurf.Rd
===================================================================
--- pkg/vegan/man/ordisurf.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/ordisurf.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -269,15 +269,15 @@
data(varechem)
vare.dist <- vegdist(varespec)
vare.mds <- monoMDS(vare.dist)
-with(varechem, ordisurf(vare.mds, Baresoil, bubble = 5))
+ordisurf(vare.mds ~ Baresoil, varechem, bubble = 5)
## as above but without the extra penalties on smooth terms,
## and using GCV smoothness selection (old behaviour of `ordisurf()`):
-with(varechem, ordisurf(vare.mds, Baresoil,col = "blue", add = TRUE,
- select = FALSE, method = "GCV.Cp"))
+ordisurf(vare.mds ~ Baresoil, varechem, col = "blue", add = TRUE,
+ select = FALSE, method = "GCV.Cp")
## Cover of Cladina arbuscula
-fit <- with(varespec, ordisurf(vare.mds, Cladarbu, family=quasipoisson))
+fit <- ordisurf(vare.mds ~ Cladarbu, varespec, family=quasipoisson)
## Get fitted values
calibrate(fit)
@@ -286,11 +286,9 @@
## of the model not just to a linear surface. There are 2
## options available:
## - option 1: `select = TRUE` --- the *default*
-with(varechem,
- ordisurf(vare.mds, Baresoil, method = "REML", select = TRUE))
+ordisurf(vare.mds ~ Baresoil, varechem, method = "REML", select = TRUE)
## - option 2: use a basis with shrinkage
-with(varechem,
- ordisurf(vare.mds, Baresoil, method = "REML", bs = "ts"))
+ordisurf(vare.mds ~ Baresoil, varechem, method = "REML", bs = "ts")
## or bs = "cs" with `isotropic = FALSE`
## Plot method
@@ -305,22 +303,21 @@
### controlling the basis functions used
## Use Duchon splines
-with(varechem, ordisurf(vare.mds, Baresoil, bs = "ds"))
+ordisurf(vare.mds ~ Baresoil, varechem, bs = "ds")
## A fixed degrees of freedom smooth, must use 'select = FALSE'
-with(varechem, ordisurf(vare.mds, Baresoil, knots = 4,
- fx = TRUE, select = FALSE))
+ordisurf(vare.mds ~ Baresoil, varechem, knots = 4,
+ fx = TRUE, select = FALSE)
## An anisotropic smoother with cubic regression spline bases
-with(varechem, ordisurf(vare.mds, Baresoil, isotropic = FALSE,
- bs = "cr", knots = 4))
+ordisurf(vare.mds ~ Baresoil, varechem, isotropic = FALSE,
+ bs = "cr", knots = 4)
## An anisotropic smoother with cubic regression spline with
## shrinkage bases & different degrees of freedom in each dimension
-with(varechem, ordisurf(vare.mds, Baresoil, isotropic = FALSE,
+ordisurf(vare.mds ~ Baresoil, varechem, isotropic = FALSE,
bs = "cs", knots = c(3,4), fx = TRUE,
- select = FALSE))
-
+ select = FALSE)
}
\keyword{ multivariate }
\keyword{ aplot }
Modified: pkg/vegan/man/permatfull.Rd
===================================================================
--- pkg/vegan/man/permatfull.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/permatfull.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -283,7 +283,7 @@
mar <- arima(bc, c(1,0,0))
mar
## Ljung-Box test of residuals
-Box.test(mar$residuals)
+Box.test(residuals(mar))
## Graphical diagnostics
tsdiag(mar)
}
Modified: pkg/vegan/man/simper.Rd
===================================================================
--- pkg/vegan/man/simper.Rd 2014-10-23 09:18:30 UTC (rev 2904)
+++ pkg/vegan/man/simper.Rd 2014-10-29 08:36:32 UTC (rev 2905)
@@ -32,8 +32,8 @@
\item{parallel}{Number of parallel processes or a predefined socket
cluster. With \code{parallel = 1} uses ordinary, non-parallel
processing. The parallel processing is done with \pkg{parallel}
- package which is available only for \R 2.14.0 and later. See
- \code{\link{vegandocs}} \code{decision-vegan} for details.}
+ package. See \code{\link{vegandocs}} \code{decision-vegan} for
+ details.}
\item{...}{Parameters passed to other functions. In \code{simper} the
extra parameters are passed to \code{\link[permute]{shuffleSet}} if
permutations are used.}
More information about the Vegan-commits
mailing list