[Vegan-commits] r2925 - in pkg/vegan: . R inst
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 9 08:44:14 CET 2015
Author: jarioksa
Date: 2015-01-09 08:44:14 +0100 (Fri, 09 Jan 2015)
New Revision: 2925
Modified:
pkg/vegan/DESCRIPTION
pkg/vegan/NAMESPACE
pkg/vegan/R/adonis.R
pkg/vegan/R/anosim.R
pkg/vegan/R/bioenv.default.R
pkg/vegan/R/estaccumR.R
pkg/vegan/R/mantel.R
pkg/vegan/R/mantel.partial.R
pkg/vegan/R/metaMDSiter.R
pkg/vegan/R/mrpp.R
pkg/vegan/R/oecosimu.R
pkg/vegan/R/ordiareatest.R
pkg/vegan/R/permutest.betadisper.R
pkg/vegan/R/permutest.cca.R
pkg/vegan/R/print.mantel.correlog.R
pkg/vegan/R/simper.R
pkg/vegan/inst/NEWS.Rd
Log:
Merge branch 'cran-2.2' into r-forge-svn-local
Modified: pkg/vegan/DESCRIPTION
===================================================================
--- pkg/vegan/DESCRIPTION 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/DESCRIPTION 2015-01-09 07:44:14 UTC (rev 2925)
@@ -1,13 +1,13 @@
Package: vegan
Title: Community Ecology Package
Version: 2.2-1
-Date: 2014-11-18
+Date: 2015-01-12
Author: Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre,
Peter R. Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos,
M. Henry H. Stevens, Helene Wagner
Maintainer: Jari Oksanen <jari.oksanen at oulu.fi>
Depends: permute (>= 0.7-8), lattice, R (>= 2.15.0)
-Suggests: tcltk
+Suggests: parallel, tcltk
Imports: MASS, cluster, mgcv
Description: Ordination methods, diversity analysis and other
functions for community and vegetation ecologists.
Modified: pkg/vegan/NAMESPACE
===================================================================
--- pkg/vegan/NAMESPACE 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/NAMESPACE 2015-01-09 07:44:14 UTC (rev 2925)
@@ -76,11 +76,12 @@
importFrom(utils, head, tail, str)
importFrom(tools, Rd2txt, startDynamicHelp)
import(lattice)
-import(parallel)
+importFrom(parallel, mclapply, makeCluster, stopCluster, clusterEvalQ,
+ parApply, parLapply, parSapply, parRapply, parCapply)
importFrom(MASS, isoMDS, sammon, Shepard, mvrnorm)
importFrom(cluster, daisy)
## 's' must be imported in mgcv < 1.8-0 (not needed later)
-importFrom(mgcv, gam, s, te)
+importFrom(mgcv, gam, s, te, predict.gam, summary.gam)
## Registration of S3 methods defined in vegan
# adipart: vegan
S3method(adipart, default)
Modified: pkg/vegan/R/adonis.R
===================================================================
--- pkg/vegan/R/adonis.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/adonis.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -103,20 +103,20 @@
isParal <- hasClus || parallel > 1
isMulticore <- .Platform$OS.type == "unix" && !hasClus
if (isParal && !isMulticore && !hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
if (isParal) {
if (isMulticore) {
f.perms <-
sapply(1:nterms, function(i)
- unlist(parallel::mclapply(1:permutations, function(j)
+ unlist(mclapply(1:permutations, function(j)
f.test(tH.s[[i]], G[p[j,], p[j,]],
df.Exp[i], df.Res, tIH.snterm),
mc.cores = parallel)))
} else {
f.perms <-
sapply(1:nterms, function(i)
- parallel::parSapply(parallel, 1:permutations, function(j)
+ parSapply(parallel, 1:permutations, function(j)
f.test(tH.s[[i]], G[p[j,], p[j,]],
df.Exp[i], df.Res, tIH.snterm)))
}
@@ -129,7 +129,7 @@
}
## Close socket cluster if created here
if (isParal && !isMulticore && !hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
## Round to avoid arbitrary P-values with tied data
f.perms <- round(f.perms, 12)
P <- (rowSums(t(f.perms) >= F.Mod)+1)/(permutations+1)
Modified: pkg/vegan/R/anosim.R
===================================================================
--- pkg/vegan/R/anosim.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/anosim.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -48,17 +48,17 @@
hasClus <- inherits(parallel, "cluster")
if (hasClus || parallel > 1) {
if(.Platform$OS.type == "unix" && !hasClus) {
- perm <- unlist(parallel::mclapply(1:permutations,
+ perm <- unlist(mclapply(1:permutations,
function(i, ...)
ptest(permat[i,]),
mc.cores = parallel))
} else {
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- perm <- parallel::parRapply(parallel, permat, ptest)
+ perm <- parRapply(parallel, permat, ptest)
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
perm <- sapply(1:permutations, function(i) ptest(permat[i,]))
Modified: pkg/vegan/R/bioenv.default.R
===================================================================
--- pkg/vegan/R/bioenv.default.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/bioenv.default.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -75,8 +75,8 @@
isParal <- hasClus || parallel > 1
isMulticore <- .Platform$OS.type == "unix" && !hasClus
if (isParal && !isMulticore && !hasClus) {
- parallel <- parallel::makeCluster(parallel)
- on.exit(parallel::stopCluster(parallel))
+ parallel <- makeCluster(parallel)
+ on.exit(stopCluster(parallel))
}
## get the number of clusters
if (inherits(parallel, "cluster"))
@@ -97,13 +97,13 @@
sets <- as.matrix(t(sets))
if (isParal && nrow(sets) >= CLUSLIM*nclus) {
if (isMulticore) {
- est <- unlist(parallel::mclapply(1:nrow(sets), function(j)
+ est <- unlist(mclapply(1:nrow(sets), function(j)
corfun(comdis,
distfun(x[,sets[j,],drop = FALSE]),
partial, method = method, ...),
mc.cores = parallel))
} else {
- est <- parallel::parSapply(parallel, 1:nrow(sets), function(j)
+ est <- parSapply(parallel, 1:nrow(sets), function(j)
corfun(comdis, distfun(x[,sets[j,],drop = FALSE]),
partial, method = method, ...))
}
Modified: pkg/vegan/R/estaccumR.R
===================================================================
--- pkg/vegan/R/estaccumR.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/estaccumR.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -16,16 +16,16 @@
hasClus <- inherits(parallel, "cluster")
if (hasClus || parallel > 1) {
if(.Platform$OS.type == "unix" && !hasClus) {
- tmp <- parallel::mclapply(1:nperm, function(i)
+ tmp <- mclapply(1:nperm, function(i)
estFun(permat[i,]),
mc.cores = parallel)
} else {
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- tmp <- parallel::parLapply(parallel, 1:nperm, function(i) estFun(permat[i,]))
+ tmp <- parLapply(parallel, 1:nperm, function(i) estFun(permat[i,]))
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
tmp <- lapply(1:permutations, function(i) estFun(permat[i,]))
Modified: pkg/vegan/R/mantel.R
===================================================================
--- pkg/vegan/R/mantel.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/mantel.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -40,16 +40,16 @@
if (hasClus || parallel > 1) {
if(.Platform$OS.type == "unix" && !hasClus) {
perm <- do.call(rbind,
- parallel::mclapply(1:permutations,
+ mclapply(1:permutations,
function(i, ...) ptest(permat[i,],...),
mc.cores = parallel))
} else {
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- perm <- parallel::parRapply(parallel, permat, ptest)
+ perm <- parRapply(parallel, permat, ptest)
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
perm <- sapply(1:permutations, function(i, ...) ptest(permat[i,], ...))
Modified: pkg/vegan/R/mantel.partial.R
===================================================================
--- pkg/vegan/R/mantel.partial.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/mantel.partial.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -48,16 +48,16 @@
if (hasClus || parallel > 1) {
if(.Platform$OS.type == "unix" && !hasClus) {
perm <- do.call(rbind,
- parallel::mclapply(1:permutations,
+ mclapply(1:permutations,
function(i, ...) ptest(permat[i,],...),
mc.cores = parallel))
} else {
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- perm <- parallel::parRapply(parallel, permat, ptest)
+ perm <- parRapply(parallel, permat, ptest)
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
perm <- sapply(1:permutations, function(i, ...) ptest(permat[i,], ...))
Modified: pkg/vegan/R/metaMDSiter.R
===================================================================
--- pkg/vegan/R/metaMDSiter.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/metaMDSiter.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -77,8 +77,8 @@
isParal <- hasClus || parallel > 1
isMulticore <- .Platform$OS.type == "unix" && !hasClus
if (isParal && !isMulticore && !hasClus) {
- parallel <-parallel:: makeCluster(parallel)
- parallel::clusterEvalQ(parallel, library(vegan))
+ parallel <- makeCluster(parallel)
+ clusterEvalQ(parallel, library(vegan))
}
## get the number of clusters
if (inherits(parallel, "cluster"))
@@ -92,7 +92,7 @@
if (isParal) {
if (isMulticore) {
stry <-
- parallel::mclapply(1:nclus, function(i)
+ mclapply(1:nclus, function(i)
switch(engine,
"monoMDS" = monoMDS(dist, init[,,i], k = k,
maxit = maxit, ...),
@@ -102,7 +102,7 @@
mc.cores = parallel)
} else {
stry <-
- parallel::parLapply(parallel, 1:nclus, function(i)
+ parLapply(parallel, 1:nclus, function(i)
switch(engine,
"monoMDS" = monoMDS(dist, init[,,i], k = k,
maxit = maxit, ...),
@@ -150,7 +150,7 @@
}
## stop socket cluster
if (isParal && !isMulticore && !hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
if (!missing(previous.best) && inherits(previous.best, "metaMDS")) {
tries <- tries + previous.best$tries
}
Modified: pkg/vegan/R/mrpp.R
===================================================================
--- pkg/vegan/R/mrpp.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/mrpp.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -54,17 +54,17 @@
hasClus <- inherits(parallel, "cluster")
if (hasClus || parallel > 1) {
if(.Platform$OS.type == "unix" && !hasClus) {
- m.ds <- unlist(parallel::mclapply(1:permutations, function(i, ...)
+ m.ds <- unlist(mclapply(1:permutations, function(i, ...)
mrpp.perms(perms[,i], dmat, indls, w),
mc.cores = parallel))
} else {
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- m.ds <- parallel::parCapply(parallel, perms, function(x)
+ m.ds <- parCapply(parallel, perms, function(x)
mrpp.perms(x, dmat, indls, w))
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
m.ds <- apply(perms, 2, function(x) mrpp.perms(x, dmat, indls, w))
Modified: pkg/vegan/R/oecosimu.R
===================================================================
--- pkg/vegan/R/oecosimu.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/oecosimu.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -96,7 +96,7 @@
## simulate if no simmat_in
if(!simmat_in)
x <- simulate(nm, nsim = batches[i], thin = thin)
- tmp <- parallel::mclapply(seq_len(batches[i]),
+ tmp <- mclapply(seq_len(batches[i]),
function(j)
applynestfun(x[,,j], fun=nestfun,
statistic = statistic, ...),
@@ -106,20 +106,20 @@
} else {
## if hasClus, do not set up and stop a temporary cluster
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
## make vegan functions available: others may be unavailable
- parallel::clusterEvalQ(parallel, library(vegan))
+ clusterEvalQ(parallel, library(vegan))
}
for(i in seq_len(nbatch)) {
if (!simmat_in)
x <- simulate(nm, nsim = batches[i], thin = thin)
simind <- cbind(simind,
- parallel::parApply(parallel, x, 3, function(z)
+ parApply(parallel, x, 3, function(z)
applynestfun(z, fun = nestfun,
statistic = statistic, ...)))
}
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
for(i in seq_len(nbatch)) {
Modified: pkg/vegan/R/ordiareatest.R
===================================================================
--- pkg/vegan/R/ordiareatest.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/ordiareatest.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -33,16 +33,16 @@
if (hasClus || parallel > 1) {
if(.Platform$OS.type == "unix" && !hasClus) {
areas <- do.call(cbind,
- parallel::mclapply(1:permutations,
+ mclapply(1:permutations,
function(i, ...) pfun(perm[i,],...),
mc.cores = parallel))
} else {
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- areas <- parallel::parApply(parallel, perm, MARGIN=1, pfun)
+ areas <- parApply(parallel, perm, MARGIN=1, pfun)
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
areas <- sapply(1:permutations, function(i, ...) pfun(perm[i,], ...))
Modified: pkg/vegan/R/permutest.betadisper.R
===================================================================
--- pkg/vegan/R/permutest.betadisper.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/permutest.betadisper.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -84,18 +84,18 @@
if (hasClus || parallel > 1L) {
if (.Platform$OS.type == "unix" && !hasClus) {
Pstats <- do.call("rbind",
- parallel::mclapply(seq_len(nperm),
+ mclapply(seq_len(nperm),
function(x) permFun(permutations[x, , drop = FALSE]),
mc.cores = parallel))
} else {
## if hasClus, don't set up and top a temporary cluster
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- Pstats <- parallel::parRapply(parallel, permutations,
+ Pstats <- parRapply(parallel, permutations,
function(x) permFun(x))
if (!hasClus) {
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
}
} else {
Modified: pkg/vegan/R/permutest.cca.R
===================================================================
--- pkg/vegan/R/permutest.cca.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/permutest.cca.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -120,18 +120,18 @@
if (hasClus || parallel > 1) {
if(.Platform$OS.type == "unix" && !hasClus) {
tmp <- do.call(rbind,
- parallel::mclapply(1:nperm,
+ mclapply(1:nperm,
function(i) getF(permutations[i,]),
mc.cores = parallel))
} else {
## if hasClus, do not set up and stop a temporary cluster
if (!hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
- tmp <- parallel::parRapply(parallel, permutations, function(i) getF(i))
+ tmp <- parRapply(parallel, permutations, function(i) getF(i))
tmp <- matrix(tmp, ncol=3, byrow=TRUE)
if (!hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
}
} else {
tmp <- getF(permutations)
Modified: pkg/vegan/R/print.mantel.correlog.R
===================================================================
--- pkg/vegan/R/print.mantel.correlog.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/print.mantel.correlog.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -6,4 +6,4 @@
cat('\n')
printCoefmat(x$mantel.res, P.values=TRUE, signif.stars=TRUE, Pvalues = TRUE)
invisible(x)
-}
\ No newline at end of file
+}
Modified: pkg/vegan/R/simper.R
===================================================================
--- pkg/vegan/R/simper.R 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/R/simper.R 2015-01-09 07:44:14 UTC (rev 2925)
@@ -42,7 +42,7 @@
isParal <- hasClus || parallel > 1
isMulticore <- .Platform$OS.type == "unix" && !hasClus
if (isParal && !isMulticore && !hasClus) {
- parallel <- parallel::makeCluster(parallel)
+ parallel <- makeCluster(parallel)
}
for (i in seq_len(nrow(comp))) {
group.a <- comm[group == comp[i, 1], , drop = FALSE]
@@ -67,11 +67,11 @@
if (isParal) {
if (isMulticore){
- perm.contr <- parallel::mclapply(seq_len(nperm), function(d)
+ perm.contr <- mclapply(seq_len(nperm), function(d)
pfun(d, comm, comp, i, contrp), mc.cores = parallel)
perm.contr <- do.call(cbind, perm.contr)
} else {
- perm.contr <- parallel::parSapply(parallel, seq_len(nperm), function(d)
+ perm.contr <- parSapply(parallel, seq_len(nperm), function(d)
pfun(d, comm, comp, i, contrp))
}
} else {
@@ -98,7 +98,7 @@
}
## Close socket cluster if created here
if (isParal && !isMulticore && !hasClus)
- parallel::stopCluster(parallel)
+ stopCluster(parallel)
attr(outlist, "permutations") <- nperm
attr(outlist, "control") <- attr(perm, "control")
class(outlist) <- "simper"
Modified: pkg/vegan/inst/NEWS.Rd
===================================================================
--- pkg/vegan/inst/NEWS.Rd 2015-01-07 13:01:37 UTC (rev 2924)
+++ pkg/vegan/inst/NEWS.Rd 2015-01-09 07:44:14 UTC (rev 2925)
@@ -8,8 +8,10 @@
\itemize{
\item This is a maintenance release to avoid warning messages
- caused by changes in CRAN repository.
-
+ caused by changes in CRAN repository. The namespace usage is also
+ more stringent to avoid warnings and notes in development versions
+ of \R.
+
}
}% end general
@@ -26,6 +28,10 @@
\subsection{BUG FIXES}{
\itemize{
+ \item \code{ordisurf} failed if \pkg{gam} package was loaded due
+ to namespace issues: some support functions of \pkg{gam} were used
+ instead of \pkg{mgcv} functions.
+
\item \code{tolerance} function failed for unconstrained
correspondence analysis.
More information about the Vegan-commits
mailing list