From noreply at r-forge.r-project.org Mon Jan 6 12:25:04 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 Jan 2014 12:25:04 +0100 (CET) Subject: [Vegan-commits] r2819 - in pkg/vegan: data inst man Message-ID: <20140106112504.57514186993@r-forge.r-project.org> Author: jarioksa Date: 2014-01-06 12:25:03 +0100 (Mon, 06 Jan 2014) New Revision: 2819 Modified: pkg/vegan/data/dune.env.rda pkg/vegan/data/dune.rda pkg/vegan/data/dune.taxon.rda pkg/vegan/inst/ChangeLog pkg/vegan/man/dune.Rd Log: cols and rows logically arranged, botanical names in 4+4 format and updated in dune data sets Modified: pkg/vegan/data/dune.env.rda =================================================================== (Binary files differ) Modified: pkg/vegan/data/dune.rda =================================================================== (Binary files differ) Modified: pkg/vegan/data/dune.taxon.rda =================================================================== (Binary files differ) Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2013-12-12 10:32:06 UTC (rev 2818) +++ pkg/vegan/inst/ChangeLog 2014-01-06 11:25:03 UTC (rev 2819) @@ -6,6 +6,13 @@ * new version opened with the CRAN release of vegan_2.0-10 on December 12, 2013. + + * dune data sets: use 4+4 letter CEP names for species instead of + old 3+3 names. Botanical nomenclature was updated: Leontodon + autumnalis -> Scorzoneroides (Leoaut -> Scorautu), Potentilla + palustris -> Comarum (Potpal -> Comapalu). Rows are now arranged + numerically, and species names alphabetically, vascular plants + first, and then the two bryophytes. Version 2.1-40 (closed December 12, 2013) Modified: pkg/vegan/man/dune.Rd =================================================================== --- pkg/vegan/man/dune.Rd 2013-12-12 10:32:06 UTC (rev 2818) +++ pkg/vegan/man/dune.Rd 2014-01-06 11:25:03 UTC (rev 2819) @@ -10,13 +10,17 @@ \description{ The dune meadow vegetation data, \code{dune}, has cover class values of 30 species on 20 sites. The corresponding environmental data frame - \code{dune.env} has following entries: -} + \code{dune.env} has following entries: } + \format{ - For \code{dune}, a data frame of observations of 30 species at 20 - sites. + \code{dune} is a data frame of observations of 30 species at 20 + sites. The species names are abbreviated to 4+4 letters (see + \code{\link{make.cepnames}}). The following names are changed from + the original source (Jongman et al. 1987): \emph{Leontodon + autumnalis} to \emph{Scorzoneroides}, and \emph{Potentilla + palustris} to \emph{Comarum}. - For \code{dune.env}, a data frame of 20 observations on the following + \code{dune.env} is a data frame of 20 observations on the following 5 variables: \describe{ \item{A1:}{a numeric vector of thickness of soil A1 horizon.} @@ -45,7 +49,6 @@ } \examples{ data(dune) - data(dune.env) } \keyword{datasets} From noreply at r-forge.r-project.org Mon Jan 6 13:31:39 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 Jan 2014 13:31:39 +0100 (CET) Subject: [Vegan-commits] r2820 - in pkg/vegan: data inst man Message-ID: <20140106123139.BE3F91869A2@r-forge.r-project.org> Author: jarioksa Date: 2014-01-06 13:31:39 +0100 (Mon, 06 Jan 2014) New Revision: 2820 Added: pkg/vegan/data/dune.phylodis.rda Modified: pkg/vegan/inst/ChangeLog pkg/vegan/man/dune.taxon.Rd pkg/vegan/man/treedive.Rd Log: add data on phylogenetic distances (coalescence ages) for dune species Added: pkg/vegan/data/dune.phylodis.rda =================================================================== (Binary files differ) Property changes on: pkg/vegan/data/dune.phylodis.rda ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-06 11:25:03 UTC (rev 2819) +++ pkg/vegan/inst/ChangeLog 2014-01-06 12:31:39 UTC (rev 2820) @@ -13,6 +13,12 @@ palustris -> Comarum (Potpal -> Comapalu). Rows are now arranged numerically, and species names alphabetically, vascular plants first, and then the two bryophytes. + + Added data 'dune.phylodis' which are ages of dune species + extracted from + http://datadryad.org/resource/doi:10.5061/dryad.63q27 (Zanne AE et + al. 2014, Nature doi:10.1038/nature12872, published online Dec 22, + 2013). Version 2.1-40 (closed December 12, 2013) Modified: pkg/vegan/man/dune.taxon.Rd =================================================================== --- pkg/vegan/man/dune.taxon.Rd 2014-01-06 11:25:03 UTC (rev 2819) +++ pkg/vegan/man/dune.taxon.Rd 2014-01-06 12:31:39 UTC (rev 2820) @@ -1,16 +1,26 @@ \name{dune.taxon} \alias{dune.taxon} +\alias{dune.phylodis} \docType{data} -\title{Taxonomic Classification of Dune Meadow Species} +\title{Taxonomic Classification and Phylogeny of Dune Meadow Species} \description{ Classification table of the species in the \code{\link{dune}} data set. } -\usage{data(dune.taxon)} +\usage{ + data(dune.taxon) + data(dune.phylodis} +} \format{ - A data frame with 30 species (rows) classified into five taxonomic - levels (columns). + + \code{dune.taxon} is data frame with 30 species (rows) classified + into five taxonomic levels (columns). \code{dune.phylodis} is a + \code{\link{dist}} object of estimated coalescence ages extracted + from \url{http://datadryad.org/resource/doi:10.5061/dryad.63q27} + (Zanne et al. 2014) using tools in packages \pkg{ape} and + \pkg{phylobase}. } + \details{ The classification of vascular plants is adapted from AGP (2003), and that of mosses from Hill et al. (2006). @@ -22,12 +32,23 @@ Hill, M.O et al. (2006) An annotated checklist of the mosses of Europe and Macaronesia. \emph{J. Bryology} \strong{28}: 198--267. + + Zanne A.E., Tank D.C., Cornwell, W.K., Eastman J.M., Smith, S.A., + FitzJohn, R.G., McGlinn, D.J., O?Meara, B.C., Moles, A.T., Reich, + P.B., Royer, D.L., Soltis, D.E., Stevens, P.F., Westoby, M., Wright, + I.J., Aarssen, L., Bertin, R.I., Calaminus, A., Govaerts, R., + Hemmings, F., Leishman, M.R., Oleksyn, J., Soltis, P.S., Swenson, + N.G., Warman, L. & Beaulieu, J.M. (2014) Three keys to the radiation + of angiosperms into freezing environments. \emph{Nature} + doi:10.1038/nature12872 (published online Dec 22, 2013). + } -\note{ - The data set was made to demonstrate \code{\link{taxondive}}, and will - probably be removed after a better example is found. + +\seealso{Functions \code{\link{taxondive}}, \code{\link{treedive}}, + and \code{\link{treedist}} use these data sets. } + +\examples{ + data(dune.taxon) + data(dune.phylodis) } -\examples{ -data(dune.taxon) -} \keyword{datasets} Modified: pkg/vegan/man/treedive.Rd =================================================================== --- pkg/vegan/man/treedive.Rd 2014-01-06 11:25:03 UTC (rev 2819) +++ pkg/vegan/man/treedive.Rd 2014-01-06 12:31:39 UTC (rev 2820) @@ -3,13 +3,14 @@ \alias{treeheight} \alias{treedist} -\title{ Functional Diversity estimated from a Species Dendrogram} -\description{ - Functional diversity is defined as the total branch length in a trait - dendrogram connecting all species, but excluding the unnecessary root - segments of the tree (Petchey and Gaston 2006). -} +\title{ Functional Diversity and Community Distances from Species Trees} +\description{ Functional diversity is defined as the total branch + length in a trait dendrogram connecting all species, but excluding + the unnecessary root segments of the tree (Petchey and Gaston + 2006). Tree distance is the increase in total branch length when + combining two sites. } + \usage{ treedive(comm, tree, match.force = FALSE) treeheight(tree) @@ -112,19 +113,22 @@ } \examples{ -## There is no data set on species properties yet, and therefore -## the example uses taxonomy + +## There is no data set on species properties yet, and we demonstrate +## the methods using phylogenetic trees data(dune) -data(dune.taxon) -d <- taxa2dist(dune.taxon, varstep=TRUE) -cl <- hclust(d, "aver") +data(dune.phylodis) +cl <- hclust(dune.phylodis) treedive(dune, cl) ## Significance test using Null model communities. -## The current choice fixes only site totals. -oecosimu(dune, treedive, "r0", tree = cl) -## Clustering of tree distances +## The current choice fixes numbers of species and picks species +## proportionally to their overall frequency +oecosimu(dune, treedive, "r1", tree = cl) +## Phylogenetically ordered community table dtree <- treedist(dune, cl) -plot(hclust(dtree, "aver")) +tabasco(dune, hclust(dtree), cl) +## Use tree distances in capscale +capscale(dtree ~ 1, comm=dune) } \keyword{ univar } From noreply at r-forge.r-project.org Mon Jan 6 14:43:20 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 Jan 2014 14:43:20 +0100 (CET) Subject: [Vegan-commits] r2821 - in pkg/vegan: data man Message-ID: <20140106134320.C68BF185E5B@r-forge.r-project.org> Author: jarioksa Date: 2014-01-06 14:43:20 +0100 (Mon, 06 Jan 2014) New Revision: 2821 Modified: pkg/vegan/data/dune.taxon.rda pkg/vegan/man/dune.taxon.Rd Log: fixes after two previous commits Modified: pkg/vegan/data/dune.taxon.rda =================================================================== (Binary files differ) Modified: pkg/vegan/man/dune.taxon.Rd =================================================================== --- pkg/vegan/man/dune.taxon.Rd 2014-01-06 12:31:39 UTC (rev 2820) +++ pkg/vegan/man/dune.taxon.Rd 2014-01-06 13:43:20 UTC (rev 2821) @@ -9,10 +9,9 @@ } \usage{ data(dune.taxon) - data(dune.phylodis} + data(dune.phylodis) } \format{ - \code{dune.taxon} is data frame with 30 species (rows) classified into five taxonomic levels (columns). \code{dune.phylodis} is a \code{\link{dist}} object of estimated coalescence ages extracted From noreply at r-forge.r-project.org Mon Jan 6 15:02:58 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 Jan 2014 15:02:58 +0100 (CET) Subject: [Vegan-commits] r2822 - in pkg/vegan: data inst man Message-ID: <20140106140258.3E962186A6A@r-forge.r-project.org> Author: jarioksa Date: 2014-01-06 15:02:57 +0100 (Mon, 06 Jan 2014) New Revision: 2822 Modified: pkg/vegan/data/BCI.rda pkg/vegan/inst/ChangeLog pkg/vegan/man/BCI.Rd Log: update botanical names in BCI Modified: pkg/vegan/data/BCI.rda =================================================================== (Binary files differ) Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-06 13:43:20 UTC (rev 2821) +++ pkg/vegan/inst/ChangeLog 2014-01-06 14:02:57 UTC (rev 2822) @@ -7,6 +7,24 @@ * new version opened with the CRAN release of vegan_2.0-10 on December 12, 2013. + * BCI: names checked after http://www.theplantlist.org, but kept + the old (alphabetic) order of species. The changes are: Abarema + macradenium -> A. macradenia, Apeiba aspera -> A. glabra, + Aspidosperma cruenta -> A. desmanthum, Chlorophora tinctoria -> + Maclura t., Coccoloba manzanillensis -> C. manzinellensis, Cupania + sylvatica -> C. seemannii, Dipteryx panamensis -> D. oleifera, + Eugenia coloradensis -> E. florida, Eugenia oerstedeana -> + E. oerstediana, Lonchocarpus latifolius -> L. heptaphyllus (this + is ambiguous, since Hebestichma cubense is another alternative), + Phoebe cinnamomifolia -> Cinnamomum triplinerve, Tabebuia guayacan + -> Handroanthus g. Guarea is ambiguous: data have three taxa + (fuzzy, grandifolia and guidonia), but theplanlist.org says + grandifolia is an ill. synonym of guidonia. This change allows + matching 206 of 225 BCI species with + http://datadryad.org/resource/doi:10.5061/dryad.63q27. In + addition, there are two vars of Swartzia simplex in BCI which + could be matched at species level. + * dune data sets: use 4+4 letter CEP names for species instead of old 3+3 names. Botanical nomenclature was updated: Leontodon autumnalis -> Scorzoneroides (Leoaut -> Scorautu), Potentilla Modified: pkg/vegan/man/BCI.Rd =================================================================== --- pkg/vegan/man/BCI.Rd 2014-01-06 13:43:20 UTC (rev 2821) +++ pkg/vegan/man/BCI.Rd 2014-01-06 14:02:57 UTC (rev 2822) @@ -8,9 +8,15 @@ } \usage{data(BCI)} \format{ - A data frame with 50 plots (rows) of 1 hectare with counts of trees on each - plot with total of 225 species (columns). Full Latin names are used - for tree species. + + A data frame with 50 plots (rows) of 1 hectare with counts of trees + on each plot with total of 225 species (columns). Full Latin names + are used for tree species. The names were updated against + \url{http://www.theplantlist.org} in Jan 2014 (see ChangeLog 2.1-41 + for details) which allows matching 206 of species against + \url{http://datadryad.org/resource/doi:10.5061/dryad.63q27} (Zanne + et al., 2014). + } \details{ Data give the numbers of trees at least 10 cm in @@ -28,11 +34,24 @@ \source{ \url{http://www.sciencemag.org/cgi/content/full/295/5555/666/DC1} } + \references{ + Condit, R, Pitman, N, Leigh, E.G., Chave, J., Terborgh, J., Foster, - R.B., \enc{Nu?ez}{Nunez}, P., Aguilar, S., Valencia, R., Villa, G., Muller-Landau, - H.C., Losos, E. & Hubbell, S.P. (2002). Beta-diversity in tropical - forest trees. \emph{Science} 295, 666--669. + R.B., \enc{Nu?ez}{Nunez}, P., Aguilar, S., Valencia, R., Villa, G., + Muller-Landau, H.C., Losos, E. & Hubbell, S.P. (2002). + Beta-diversity in tropical forest trees. \emph{Science} 295, + 666--669. + + Zanne A.E., Tank D.C., Cornwell, W.K., Eastman J.M., Smith, S.A., + FitzJohn, R.G., McGlinn, D.J., O?Meara, B.C., Moles, A.T., Reich, + P.B., Royer, D.L., Soltis, D.E., Stevens, P.F., Westoby, M., Wright, + I.J., Aarssen, L., Bertin, R.I., Calaminus, A., Govaerts, R., + Hemmings, F., Leishman, M.R., Oleksyn, J., Soltis, P.S., Swenson, + N.G., Warman, L. & Beaulieu, J.M. (2014) Three keys to the radiation + of angiosperms into freezing environments. \emph{Nature} + doi:10.1038/nature12872 (published online Dec 22, 2013). + } \seealso{\code{\link[BiodiversityR]{BCI.env}} in \pkg{BiodiversityR} package for environmental data (coordinates are given below in the From noreply at r-forge.r-project.org Mon Jan 6 17:40:25 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 Jan 2014 17:40:25 +0100 (CET) Subject: [Vegan-commits] r2823 - in pkg/vegan: R inst Message-ID: <20140106164025.48298183CEE@r-forge.r-project.org> Author: jarioksa Date: 2014-01-06 17:40:24 +0100 (Mon, 06 Jan 2014) New Revision: 2823 Modified: pkg/vegan/R/anosim.R pkg/vegan/R/mantel.R pkg/vegan/R/mantel.partial.R pkg/vegan/inst/ChangeLog Log: ... may be used in an incorrect context: revert r2765 Modified: pkg/vegan/R/anosim.R =================================================================== --- pkg/vegan/R/anosim.R 2014-01-06 14:02:57 UTC (rev 2822) +++ pkg/vegan/R/anosim.R 2014-01-06 16:40:24 UTC (rev 2823) @@ -55,7 +55,7 @@ if(.Platform$OS.type == "unix" && !hasClus) { perm <- unlist(mclapply(1:permutations, function(i, ...) ptest(permat[i,]), - mc.cores = parallel, ...)) + mc.cores = parallel)) } else { if (!hasClus) { parallel <- makeCluster(parallel) Modified: pkg/vegan/R/mantel.R =================================================================== --- pkg/vegan/R/mantel.R 2014-01-06 14:02:57 UTC (rev 2822) +++ pkg/vegan/R/mantel.R 2014-01-06 16:40:24 UTC (rev 2823) @@ -49,7 +49,7 @@ perm <- do.call(rbind, mclapply(1:permutations, function(i, ...) ptest(permat[i,],...), - mc.cores = parallel, ...)) + mc.cores = parallel)) } else { if (!hasClus) { parallel <- makeCluster(parallel) Modified: pkg/vegan/R/mantel.partial.R =================================================================== --- pkg/vegan/R/mantel.partial.R 2014-01-06 14:02:57 UTC (rev 2822) +++ pkg/vegan/R/mantel.partial.R 2014-01-06 16:40:24 UTC (rev 2823) @@ -57,7 +57,7 @@ perm <- do.call(rbind, mclapply(1:permutations, function(i, ...) ptest(permat[i,],...), - mc.cores = parallel, ...)) + mc.cores = parallel)) } else { if (!hasClus) { parallel <- makeCluster(parallel) Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-06 14:02:57 UTC (rev 2822) +++ pkg/vegan/inst/ChangeLog 2014-01-06 16:40:24 UTC (rev 2823) @@ -7,6 +7,10 @@ * new version opened with the CRAN release of vegan_2.0-10 on December 12, 2013. + * anosim, mantel, mantel.partial: R CMD check told that "... may + be used in an incorrect context". The dots were added in r2765, + and now removed. + * BCI: names checked after http://www.theplantlist.org, but kept the old (alphabetic) order of species. The changes are: Abarema macradenium -> A. macradenia, Apeiba aspera -> A. glabra, From noreply at r-forge.r-project.org Tue Jan 7 09:09:25 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 7 Jan 2014 09:09:25 +0100 (CET) Subject: [Vegan-commits] r2824 - pkg/vegan/man Message-ID: <20140107080925.82281181360@r-forge.r-project.org> Author: jarioksa Date: 2014-01-07 09:09:25 +0100 (Tue, 07 Jan 2014) New Revision: 2824 Modified: pkg/vegan/man/dune.taxon.Rd Log: add encoding Modified: pkg/vegan/man/dune.taxon.Rd =================================================================== --- pkg/vegan/man/dune.taxon.Rd 2014-01-06 16:40:24 UTC (rev 2823) +++ pkg/vegan/man/dune.taxon.Rd 2014-01-07 08:09:25 UTC (rev 2824) @@ -1,3 +1,4 @@ +\encoding{UTF-8} \name{dune.taxon} \alias{dune.taxon} \alias{dune.phylodis} From noreply at r-forge.r-project.org Tue Jan 7 09:30:25 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 7 Jan 2014 09:30:25 +0100 (CET) Subject: [Vegan-commits] r2825 - in pkg/vegan: data inst Message-ID: <20140107083025.CE6661869BE@r-forge.r-project.org> Author: jarioksa Date: 2014-01-07 09:30:25 +0100 (Tue, 07 Jan 2014) New Revision: 2825 Modified: pkg/vegan/data/varespec.rda pkg/vegan/inst/ChangeLog Log: use 4+4 CEP names in varespec Modified: pkg/vegan/data/varespec.rda =================================================================== (Binary files differ) Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-07 08:09:25 UTC (rev 2824) +++ pkg/vegan/inst/ChangeLog 2014-01-07 08:30:25 UTC (rev 2825) @@ -41,6 +41,14 @@ http://datadryad.org/resource/doi:10.5061/dryad.63q27 (Zanne AE et al. 2014, Nature doi:10.1038/nature12872, published online Dec 22, 2013). + + * varespec: use 4+4 letter CEP names instead of 3+dot+3. + Nomenclature was cautiously fixed. Most important changes: Ledum + palustre -> Rhododendron tomentosum (Led.pal -> Rhodtome), + Cetraria nivalis -> Flavocetraria nivalis (Cet.niv -> + Flavniva). In addition, Dip.mon was corrected to Diphcomp + (Diphasiastrum complanatum, should perhaps be Lycopodium c.), and + Barbilophozia lycopodioides to B. hatcheri. Version 2.1-40 (closed December 12, 2013) From noreply at r-forge.r-project.org Tue Jan 7 09:37:47 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 7 Jan 2014 09:37:47 +0100 (CET) Subject: [Vegan-commits] r2826 - pkg/vegan/man Message-ID: <20140107083747.61EA5186B93@r-forge.r-project.org> Author: jarioksa Date: 2014-01-07 09:37:46 +0100 (Tue, 07 Jan 2014) New Revision: 2826 Modified: pkg/vegan/man/ordisurf.Rd Log: adapt to 4+4 names in varespec (r2825) Modified: pkg/vegan/man/ordisurf.Rd =================================================================== --- pkg/vegan/man/ordisurf.Rd 2014-01-07 08:30:25 UTC (rev 2825) +++ pkg/vegan/man/ordisurf.Rd 2014-01-07 08:37:46 UTC (rev 2826) @@ -277,7 +277,7 @@ select = FALSE, method = "GCV.Cp")) ## Cover of Cladina arbuscula -fit <- with(varespec, ordisurf(vare.mds, Cla.arb, family=quasipoisson)) +fit <- with(varespec, ordisurf(vare.mds, Cladarbu, family=quasipoisson)) ## Get fitted values calibrate(fit) From noreply at r-forge.r-project.org Tue Jan 7 09:38:34 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 7 Jan 2014 09:38:34 +0100 (CET) Subject: [Vegan-commits] r2827 - pkg/vegan/tests/Examples Message-ID: <20140107083834.417D8186BA4@r-forge.r-project.org> Author: jarioksa Date: 2014-01-07 09:38:33 +0100 (Tue, 07 Jan 2014) New Revision: 2827 Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save Log: community data were renamed and reorganized: examples change Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save =================================================================== --- pkg/vegan/tests/Examples/vegan-Ex.Rout.save 2014-01-07 08:37:46 UTC (rev 2826) +++ pkg/vegan/tests/Examples/vegan-Ex.Rout.save 2014-01-07 08:38:33 UTC (rev 2827) @@ -1,6 +1,6 @@ -R Under development (unstable) (2013-11-15 r64218) -- "Unsuffered Consequences" -Copyright (C) 2013 The R Foundation for Statistical Computing +R Under development (unstable) (2014-01-07 r64685) -- "Unsuffered Consequences" +Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -23,7 +23,7 @@ > library('vegan') Loading required package: permute Loading required package: lattice -This is vegan 2.1-39 +This is vegan 2.1-41 > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > cleanEx() @@ -155,14 +155,14 @@ > ordisurf(mod ~ pH, varechem, knots = 1, add = TRUE) Loading required package: mgcv Loading required package: nlme -This is mgcv 1.7-26. For overview type 'help("mgcv-package")'. +This is mgcv 1.7-27. For overview type 'help("mgcv-package")'. Family: gaussian Link function: identity Formula: y ~ poly(x1, 1) + poly(x2, 1) - + Total model degrees of freedom 3 REML score: -3.185099 @@ -395,26 +395,26 @@ Start: AIC=87.66 dune ~ 1 - Df AIC F N.Perm Pr(>F) -+ Moisture 3 86.608 2.2536 199 0.010 ** -+ Management 3 86.935 2.1307 199 0.005 ** -+ A1 1 87.411 2.1400 199 0.020 * - 87.657 -+ Manure 4 88.832 1.5251 199 0.025 * -+ Use 2 89.134 1.1431 99 0.250 + Df AIC F Pr(>F) ++ Moisture 3 86.608 2.2536 0.005 ** ++ Management 3 86.935 2.1307 0.005 ** ++ A1 1 87.411 2.1400 0.025 * + 87.657 ++ Manure 4 88.832 1.5251 0.045 * ++ Use 2 89.134 1.1431 0.295 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Step: AIC=86.61 dune ~ Moisture - Df AIC F N.Perm Pr(>F) - 86.608 -+ Management 3 86.813 1.4565 199 0.020 * -+ A1 1 86.992 1.2624 99 0.150 -+ Use 2 87.259 1.2760 199 0.120 -+ Manure 4 87.342 1.3143 199 0.090 . -- Moisture 3 87.657 2.2536 199 0.005 ** + Df AIC F Pr(>F) + 86.608 ++ Management 3 86.813 1.4565 0.045 * ++ A1 1 86.992 1.2624 0.150 ++ Use 2 87.259 1.2760 0.120 ++ Manure 4 87.342 1.3143 0.040 * +- Moisture 3 87.657 2.2536 0.010 ** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Call: cca(formula = dune ~ Moisture, data = dune.env) @@ -446,40 +446,40 @@ > m0 <- rda(dune ~ 1, dune.env) > ## -- manual selection and updating > add1(m0, scope=formula(mbig), test="perm") - Df AIC F N.Perm Pr(>F) - 89.620 -A1 1 89.591 1.9217 199 0.070 . -Moisture 3 87.707 2.5883 199 0.005 ** -Management 3 87.082 2.8400 199 0.005 ** -Use 2 91.032 1.1741 99 0.180 -Manure 4 89.232 1.9539 199 0.010 ** + Df AIC F Pr(>F) + 89.620 +A1 1 89.591 1.9217 0.060 . +Moisture 3 87.707 2.5883 0.005 ** +Management 3 87.082 2.8400 0.005 ** +Use 2 91.032 1.1741 0.280 +Manure 4 89.232 1.9539 0.015 * --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > m0 <- update(m0, . ~ . + Management) > add1(m0, scope=formula(mbig), test="perm") - Df AIC F N.Perm Pr(>F) - 87.082 -A1 1 87.424 1.2965 99 0.240 -Moisture 3 85.567 1.9764 199 0.005 ** -Use 2 88.284 1.0510 99 0.430 -Manure 3 87.517 1.3902 199 0.130 + Df AIC F Pr(>F) + 87.082 +A1 1 87.424 1.2965 0.175 +Moisture 3 85.567 1.9764 0.005 ** +Use 2 88.284 1.0510 0.440 +Manure 3 87.517 1.3902 0.095 . --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > m0 <- update(m0, . ~ . + Moisture) > ## -- included variables still significant? > drop1(m0, test="perm") - Df AIC F N.Perm Pr(>F) - 85.567 -Management 3 87.707 2.1769 199 0.010 ** -Moisture 3 87.082 1.9764 199 0.015 * + Df AIC F Pr(>F) + 85.567 +Management 3 87.707 2.1769 0.010 ** +Moisture 3 87.082 1.9764 0.005 ** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > add1(m0, scope=formula(mbig), test="perm") - Df AIC F N.Perm Pr(>F) - 85.567 -A1 1 86.220 0.8359 99 0.72 -Use 2 86.842 0.8027 99 0.77 -Manure 3 85.762 1.1225 99 0.26 + Df AIC F Pr(>F) + 85.567 +A1 1 86.220 0.8359 0.645 +Use 2 86.842 0.8027 0.700 +Manure 3 85.762 1.1225 0.320 > > > @@ -638,8 +638,8 @@ Df SumsOfSqs MeanSqs F.Model R2 Pr(>F) Management 3 1.4686 0.48953 3.2629 0.34161 0.01 ** -A1 1 0.4409 0.44089 2.9387 0.10256 0.02 * -Management:A1 3 0.5892 0.19639 1.3090 0.13705 0.18 +A1 1 0.4409 0.44089 2.9387 0.10256 0.04 * +Management:A1 3 0.5892 0.19639 1.3090 0.13705 0.23 Residuals 12 1.8004 0.15003 0.41878 Total 19 4.2990 1.00000 --- @@ -741,13 +741,13 @@ Dissimilarity: bray ANOSIM statistic R: 0.2579 - Significance: 0.006 + Significance: 0.017 Based on 999 permutations Upper quantiles of permutations (null model): 90% 95% 97.5% 99% -0.116 0.160 0.203 0.233 +0.121 0.174 0.222 0.276 Dissimilarity ranks between and within classes: 0% 25% 50% 75% 100% N @@ -775,8 +775,7 @@ > ### Name: anova.cca > ### Title: Permutation Test for Constrained Correspondence Analysis, > ### Redundancy Analysis and Constrained Analysis of Principal Coordinates -> ### Aliases: anova.cca anova.ccanull anova.ccabyaxis anova.ccabyterm -> ### anova.ccabymargin anova.prc permutest permutest.default permutest.cca +> ### Aliases: anova.cca permutest permutest.cca > ### Keywords: multivariate htest > > ### ** Examples @@ -787,94 +786,19 @@ > ## overall test > anova(vare.cca) Permutation test for cca under reduced model +Permutation: free +Number of permutations: 999 Model: cca(formula = varespec ~ Al + P + K, data = varechem) - Df Chisq F N.Perm Pr(>F) -Model 3 0.6441 2.9840 199 0.005 ** -Residual 20 1.4391 + Df ChiSquare F Pr(>F) +Model 3 0.64413 2.984 0.001 *** +Residual 20 1.43906 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 -> ## Test for axes -> anova(vare.cca, by="axis", perm.max=500) -Model: cca(formula = varespec ~ Al + P + K, data = varechem) - Df Chisq F N.Perm Pr(>F) -CCA1 1 0.3616 5.0249 199 0.005 ** -CCA2 1 0.1700 2.3621 199 0.010 ** -CCA3 1 0.1126 1.5651 399 0.100 . -Residual 20 1.4391 ---- -Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 -> ## Sequential test for terms -> anova(vare.cca, by="terms", permu=200) -Permutation test for cca under reduced model -Terms added sequentially (first to last) - -Model: cca(formula = varespec ~ Al + P + K, data = varechem) - Df Chisq F N.Perm Pr(>F) -Al 1 0.2982 4.1440 199 0.005 ** -P 1 0.1899 2.6393 199 0.015 * -K 1 0.1561 2.1688 199 0.030 * -Residual 20 1.4391 ---- -Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 -> ## Marginal or Type III effects -> anova(vare.cca, by="margin") -Permutation test for cca under reduced model -Marginal effects of terms - -Model: cca(formula = varespec ~ Al + P + K, data = varechem) - Df Chisq F N.Perm Pr(>F) -Al 1 0.3118 4.3340 199 0.00500 ** -P 1 0.1681 2.3362 199 0.01500 * -K 1 0.1561 2.1688 599 0.02833 * -Residual 20 1.4391 ---- -Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 -> ## Marginal test knows 'scope' -> anova(vare.cca, by = "m", scope="P") -Permutation test for cca under reduced model -Marginal effects of terms - -Model: cca(formula = varespec ~ Al + P + K, data = varechem) - Df Chisq F N.Perm Pr(>F) -P 1 0.1681 2.3362 199 0.015 * -Residual 20 1.4391 ---- -Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > > > > cleanEx() -> nameEx("anovacca") -> ### * anovacca -> -> flush(stderr()); flush(stdout()) -> -> ### Name: anovacca -> ### Title: Permutation Test for Constrained Correspondence Analysis, -> ### Redundancy Analysis and Constrained Analysis of Principal Coordinates -> ### Aliases: anovacca -> ### Keywords: multivariate htest -> -> ### ** Examples -> -> data(varespec) -> data(varechem) -> vare.cca <- cca(varespec ~ Al + P + K, varechem) -> ## overall test -> anovacca(vare.cca) -Permutation test for cca under reduced model - -Model: cca(formula = varespec ~ Al + P + K, data = varechem) - Df Chisq F N.Perm Pr(>F) -Model 3 0.6441 2.9840 999 0.001 *** -Residual 20 1.4391 ---- -Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 -> -> -> -> cleanEx() > nameEx("as.mlm") > ### * as.mlm > @@ -992,121 +916,121 @@ > boxplot(as.vector(x) ~ unlist(pa), xlab="Presence", ylab="Beals") > ## Remove the bias of tarbet species: Yields lower values. > beals(dune, type =3, include = FALSE) - Belper Empnig Junbuf Junart Airpra Elepal Rumace -2 0.4917791 0.01829337 0.2070478 0.13017869 0.03361524 0.08656209 0.3031318 -13 0.2939740 0.01840390 0.3339728 0.28204736 0.02191119 0.22437598 0.3107471 -4 0.4398775 0.02527165 0.2318440 0.21320122 0.02876960 0.16112450 0.2610006 -16 0.1516354 0.00742115 0.1776781 0.54304667 0.00742115 0.51523810 0.1508409 -6 0.3696613 0.03093489 0.2166255 0.11631772 0.05967771 0.08784329 0.4330705 -1 0.4935662 0.00000000 0.1987270 0.14794933 0.01157407 0.05592045 0.3160963 -8 0.2720122 0.02102222 0.2323566 0.33219882 0.02588333 0.29777644 0.2331043 -5 0.4322142 0.03029752 0.2164230 0.10406655 0.06632771 0.05419613 0.3979230 -17 0.3129358 0.21968254 0.1038156 0.03333333 0.29233391 0.02777778 0.2913631 -15 0.1420251 0.02215971 0.1370235 0.51561767 0.02538032 0.53973883 0.1459458 -10 0.4705094 0.03425596 0.1678040 0.09080902 0.07349127 0.07787078 0.3226025 -11 0.3713794 0.07310076 0.1656396 0.13478872 0.10259239 0.11146095 0.2753878 -9 0.3292320 0.01838883 0.2675624 0.23134366 0.02213662 0.19018562 0.3464870 -18 0.3676424 0.06763669 0.1376386 0.18956922 0.08535723 0.17341352 0.2668100 -3 0.4033301 0.01074444 0.2544828 0.22291082 0.01520046 0.16099072 0.2909068 -20 0.1450721 0.05905666 0.1192488 0.53056145 0.06144615 0.58476297 0.1098600 -14 0.1682755 0.01989756 0.1206518 0.46685537 0.02298398 0.55982776 0.1241545 -19 0.2237843 0.26011417 0.1127832 0.13543701 0.35137675 0.12592768 0.1831168 -12 0.2802946 0.03413656 0.3231724 0.27306206 0.03625297 0.19518888 0.3507140 -7 0.4051777 0.02304603 0.2110045 0.11293676 0.05329633 0.06694311 0.4113622 - Viclat Brarut Ranfla Cirarv Hyprad Leoaut Potpal -2 0.18494940 0.7415172 0.13042865 0.08570299 0.07454127 0.9349640 0.026548839 -13 0.06604026 0.7465509 0.33309468 0.07905124 0.04250245 0.9255312 0.056084315 -4 0.12550967 0.7919786 0.21909541 0.12920228 0.06985986 0.9204237 0.039859621 -16 0.03353260 0.8029953 0.66893881 0.05184498 0.01731602 0.8131968 0.201352298 -6 0.18035860 0.8387650 0.10909966 0.03223112 0.11463153 0.9590466 0.030347896 -1 0.17244420 0.7476589 0.08105273 0.09504980 0.07702746 0.8898317 0.000000000 -8 0.10213052 0.8109194 0.40134447 0.06688407 0.06550319 0.8755515 0.100703044 -5 0.16693075 0.8079786 0.08063087 0.05520104 0.10245961 0.9576838 0.015892090 -17 0.20728700 0.7635487 0.03549383 0.01049383 0.36492870 0.9839744 0.009876543 -15 0.07370069 0.7997141 0.64449081 0.04022968 0.05040404 0.8430677 0.198176675 -10 0.23383453 0.7660374 0.10355742 0.06037513 0.13692492 0.9568824 0.029746617 -11 0.24317802 0.8182692 0.13269569 0.05778318 0.18108995 0.9442707 0.035740922 -9 0.08630413 0.7972178 0.26006489 0.07647268 0.05343787 0.9145996 0.045830682 -18 0.26222869 0.8397471 0.18805395 0.04454602 0.17491099 0.9554011 0.042890320 -3 0.12833142 0.7666969 0.22632936 0.08967477 0.05562332 0.9036443 0.031898812 -20 0.09111967 0.8397124 0.62796060 0.03453783 0.07795311 0.8457313 0.185726965 -14 0.07857237 0.7238162 0.64674225 0.03618335 0.04665747 0.8477706 0.241811837 -19 0.18188455 0.8161275 0.14551892 0.03668466 0.39145281 0.9902041 0.031845637 -12 0.08049055 0.8061715 0.29873222 0.07799259 0.06777311 0.9377963 0.045375827 -7 0.19027523 0.8089116 0.10541081 0.04706743 0.10837376 0.9550487 0.017083997 - Poapra Calcus Tripra Trirep Antodo Salrep Achmil -2 0.8972046 0.034597921 0.20673650 0.9125666 0.34723984 0.05983781 0.47083676 -13 0.7063028 0.122856392 0.11199114 0.8841739 0.16737280 0.06572594 0.21850759 -4 0.7940926 0.081110164 0.12896524 0.8943213 0.21542662 0.07579199 0.30816435 -16 0.4124222 0.364128496 0.03916718 0.6776273 0.05538377 0.15783292 0.06335463 -6 0.8666677 0.040981168 0.35423465 0.9110822 0.53154426 0.08921540 0.58819821 -1 0.9863946 0.003527337 0.21701279 0.8782576 0.30827883 0.02729885 0.49590853 -8 0.6160461 0.201958942 0.09897600 0.8002526 0.16247716 0.11569906 0.21230502 -5 0.9035899 0.023129027 0.34808957 0.9142360 0.48876285 0.07589611 0.59949785 -17 0.7434618 0.009876543 0.27593101 0.8141660 0.69331132 0.25651777 0.55254140 -15 0.4078219 0.381379395 0.05831084 0.7170446 0.10117099 0.17750323 0.09168815 -10 0.8915882 0.033527777 0.26807372 0.9003730 0.42671693 0.09037489 0.54083871 -11 0.8062720 0.043950322 0.19982976 0.8979262 0.38766111 0.16465286 0.40509331 -9 0.7523318 0.092982775 0.16269563 0.8714833 0.21896113 0.07351827 0.30323659 -18 0.7368632 0.109959916 0.20461193 0.8600701 0.36918166 0.17191937 0.37751017 -3 0.8083020 0.075789630 0.14654749 0.8817430 0.21609954 0.06065155 0.34063019 -20 0.3662817 0.397924041 0.03708580 0.6350394 0.10738280 0.21674174 0.05429986 -14 0.3817081 0.347514804 0.06176123 0.6485949 0.12128973 0.15917563 0.13570397 -19 0.5548077 0.082361157 0.11966159 0.8147968 0.51929869 0.36429493 0.29826049 -12 0.6932541 0.100954127 0.13849854 0.9079979 0.20078932 0.08041977 0.21008725 -7 0.8925059 0.024070054 0.32489503 0.9171688 0.48010987 0.07094548 0.56496165 - Poatri Chealb Elyrep Sagpro Plalan Agrsto Lolper -2 0.8288385 0.043866562 0.4407282 0.3302063 0.40700777 0.39501120 0.8272395 -13 0.7993754 0.122547745 0.3511708 0.5131337 0.18153869 0.68239707 0.5714581 -4 0.8197302 0.057970906 0.4399661 0.4191908 0.25797285 0.51198853 0.7197924 -16 0.6071083 0.056246994 0.1832397 0.3480368 0.07269979 0.87877202 0.3561752 -6 0.7782619 0.021256367 0.3138879 0.2539380 0.58765018 0.26299306 0.8000021 -1 0.8826329 0.025132275 0.4667439 0.3371121 0.40103107 0.38333415 0.9226190 -8 0.7101299 0.063278453 0.3046956 0.4009544 0.20596764 0.66906674 0.5403355 -5 0.8094632 0.026434737 0.3575948 0.2612828 0.52628928 0.27622698 0.8380779 -17 0.5036834 0.007716049 0.1929470 0.3292030 0.59641331 0.07330247 0.5858415 -15 0.5263520 0.035609053 0.1462975 0.3151199 0.13523214 0.79412733 0.3689922 -10 0.7543592 0.025686639 0.3736128 0.2732735 0.52588347 0.26902092 0.8102783 -11 0.6404351 0.021234732 0.2884798 0.3673397 0.47012501 0.31656550 0.7180948 -9 0.8247374 0.069879277 0.3523460 0.4531178 0.25274756 0.59744543 0.6874068 -18 0.5859071 0.014640428 0.2651538 0.3154533 0.45087176 0.34451209 0.7124388 -3 0.8383185 0.065338638 0.4137888 0.4204104 0.27933493 0.52738394 0.7205525 -20 0.4523029 0.037623741 0.1168700 0.3105433 0.13059496 0.76675441 0.3262685 -14 0.5090703 0.042990591 0.1428372 0.2528665 0.14342002 0.76284476 0.3356311 -19 0.3605827 0.019591245 0.1422725 0.4798245 0.40784415 0.25952255 0.4289185 -12 0.8199960 0.103543341 0.3354080 0.5122033 0.22110550 0.66278454 0.5875943 -7 0.8018775 0.038467708 0.3586644 0.2954682 0.51905808 0.29412293 0.8053380 - Alogen Brohor -2 0.4718807 0.42000984 -13 0.6404427 0.24942466 -4 0.5971801 0.35732610 -16 0.5232448 0.09458531 -6 0.2700508 0.39760652 -1 0.4923280 0.43263047 -8 0.5187956 0.21219877 -5 0.3349203 0.44309579 -17 0.1013889 0.34982363 -15 0.4505613 0.09794548 -10 0.3372958 0.42934344 -11 0.3185489 0.31413659 -9 0.5792855 0.28613526 -18 0.2838834 0.30478244 -3 0.5309152 0.33010938 -20 0.4063662 0.06706410 -14 0.4107645 0.13757552 -19 0.1934048 0.18074796 -12 0.5753377 0.22974415 -7 0.3403047 0.40471531 + Achimill Agrostol Airaprae Alopgeni Anthodor Bellpere Bromhord +1 0.49590853 0.38333415 0.01157407 0.4923280 0.30827883 0.4935662 0.43263047 +2 0.47083676 0.39501120 0.03361524 0.4718807 0.34723984 0.4917791 0.42000984 +3 0.34063019 0.52738394 0.01520046 0.5309152 0.21609954 0.4033301 0.33010938 +4 0.30816435 0.51198853 0.02876960 0.5971801 0.21542662 0.4398775 0.35732610 +5 0.59949785 0.27622698 0.06632771 0.3349203 0.48876285 0.4322142 0.44309579 +6 0.58819821 0.26299306 0.05967771 0.2700508 0.53154426 0.3696613 0.39760652 +7 0.56496165 0.29412293 0.05329633 0.3403047 0.48010987 0.4051777 0.40471531 +8 0.21230502 0.66906674 0.02588333 0.5187956 0.16247716 0.2720122 0.21219877 +9 0.30323659 0.59744543 0.02213662 0.5792855 0.21896113 0.3292320 0.28613526 +10 0.54083871 0.26902092 0.07349127 0.3372958 0.42671693 0.4705094 0.42934344 +11 0.40509331 0.31656550 0.10259239 0.3185489 0.38766111 0.3713794 0.31413659 +12 0.21008725 0.66278454 0.03625297 0.5753377 0.20078932 0.2802946 0.22974415 +13 0.21850759 0.68239707 0.02191119 0.6404427 0.16737280 0.2939740 0.24942466 +14 0.13570397 0.76284476 0.02298398 0.4107645 0.12128973 0.1682755 0.13757552 +15 0.09168815 0.79412733 0.02538032 0.4505613 0.10117099 0.1420251 0.09794548 +16 0.06335463 0.87877202 0.00742115 0.5232448 0.05538377 0.1516354 0.09458531 +17 0.55254140 0.07330247 0.29233391 0.1013889 0.69331132 0.3129358 0.34982363 +18 0.37751017 0.34451209 0.08535723 0.2838834 0.36918166 0.3676424 0.30478244 +19 0.29826049 0.25952255 0.35137675 0.1934048 0.51929869 0.2237843 0.18074796 +20 0.05429986 0.76675441 0.06144615 0.4063662 0.10738280 0.1450721 0.06706410 + Chenalbu Cirsarve Comapalu Eleopalu Elymrepe Empenigr +1 0.025132275 0.09504980 0.000000000 0.05592045 0.4667439 0.00000000 +2 0.043866562 0.08570299 0.026548839 0.08656209 0.4407282 0.01829337 +3 0.065338638 0.08967477 0.031898812 0.16099072 0.4137888 0.01074444 +4 0.057970906 0.12920228 0.039859621 0.16112450 0.4399661 0.02527165 +5 0.026434737 0.05520104 0.015892090 0.05419613 0.3575948 0.03029752 +6 0.021256367 0.03223112 0.030347896 0.08784329 0.3138879 0.03093489 +7 0.038467708 0.04706743 0.017083997 0.06694311 0.3586644 0.02304603 +8 0.063278453 0.06688407 0.100703044 0.29777644 0.3046956 0.02102222 +9 0.069879277 0.07647268 0.045830682 0.19018562 0.3523460 0.01838883 +10 0.025686639 0.06037513 0.029746617 0.07787078 0.3736128 0.03425596 +11 0.021234732 0.05778318 0.035740922 0.11146095 0.2884798 0.07310076 +12 0.103543341 0.07799259 0.045375827 0.19518888 0.3354080 0.03413656 +13 0.122547745 0.07905124 0.056084315 0.22437598 0.3511708 0.01840390 +14 0.042990591 0.03618335 0.241811837 0.55982776 0.1428372 0.01989756 +15 0.035609053 0.04022968 0.198176675 0.53973883 0.1462975 0.02215971 +16 0.056246994 0.05184498 0.201352298 0.51523810 0.1832397 0.00742115 +17 0.007716049 0.01049383 0.009876543 0.02777778 0.1929470 0.21968254 +18 0.014640428 0.04454602 0.042890320 0.17341352 0.2651538 0.06763669 +19 0.019591245 0.03668466 0.031845637 0.12592768 0.1422725 0.26011417 +20 0.037623741 0.03453783 0.185726965 0.58476297 0.1168700 0.05905666 + Hyporadi Juncarti Juncbufo Lolipere Planlanc Poaprat Poatriv +1 0.07702746 0.14794933 0.1987270 0.9226190 0.40103107 0.9863946 0.8826329 +2 0.07454127 0.13017869 0.2070478 0.8272395 0.40700777 0.8972046 0.8288385 +3 0.05562332 0.22291082 0.2544828 0.7205525 0.27933493 0.8083020 0.8383185 +4 0.06985986 0.21320122 0.2318440 0.7197924 0.25797285 0.7940926 0.8197302 +5 0.10245961 0.10406655 0.2164230 0.8380779 0.52628928 0.9035899 0.8094632 +6 0.11463153 0.11631772 0.2166255 0.8000021 0.58765018 0.8666677 0.7782619 +7 0.10837376 0.11293676 0.2110045 0.8053380 0.51905808 0.8925059 0.8018775 +8 0.06550319 0.33219882 0.2323566 0.5403355 0.20596764 0.6160461 0.7101299 +9 0.05343787 0.23134366 0.2675624 0.6874068 0.25274756 0.7523318 0.8247374 +10 0.13692492 0.09080902 0.1678040 0.8102783 0.52588347 0.8915882 0.7543592 +11 0.18108995 0.13478872 0.1656396 0.7180948 0.47012501 0.8062720 0.6404351 +12 0.06777311 0.27306206 0.3231724 0.5875943 0.22110550 0.6932541 0.8199960 +13 0.04250245 0.28204736 0.3339728 0.5714581 0.18153869 0.7063028 0.7993754 +14 0.04665747 0.46685537 0.1206518 0.3356311 0.14342002 0.3817081 0.5090703 +15 0.05040404 0.51561767 0.1370235 0.3689922 0.13523214 0.4078219 0.5263520 +16 0.01731602 0.54304667 0.1776781 0.3561752 0.07269979 0.4124222 0.6071083 +17 0.36492870 0.03333333 0.1038156 0.5858415 0.59641331 0.7434618 0.5036834 +18 0.17491099 0.18956922 0.1376386 0.7124388 0.45087176 0.7368632 0.5859071 +19 0.39145281 0.13543701 0.1127832 0.4289185 0.40784415 0.5548077 0.3605827 +20 0.07795311 0.53056145 0.1192488 0.3262685 0.13059496 0.3662817 0.4523029 + Ranuflam Rumeacet Sagiproc Salirepe Scorautu Trifprat Trifrepe +1 0.08105273 0.3160963 0.3371121 0.02729885 0.8898317 0.21701279 0.8782576 +2 0.13042865 0.3031318 0.3302063 0.05983781 0.9349640 0.20673650 0.9125666 +3 0.22632936 0.2909068 0.4204104 0.06065155 0.9036443 0.14654749 0.8817430 +4 0.21909541 0.2610006 0.4191908 0.07579199 0.9204237 0.12896524 0.8943213 +5 0.08063087 0.3979230 0.2612828 0.07589611 0.9576838 0.34808957 0.9142360 +6 0.10909966 0.4330705 0.2539380 0.08921540 0.9590466 0.35423465 0.9110822 +7 0.10541081 0.4113622 0.2954682 0.07094548 0.9550487 0.32489503 0.9171688 +8 0.40134447 0.2331043 0.4009544 0.11569906 0.8755515 0.09897600 0.8002526 +9 0.26006489 0.3464870 0.4531178 0.07351827 0.9145996 0.16269563 0.8714833 +10 0.10355742 0.3226025 0.2732735 0.09037489 0.9568824 0.26807372 0.9003730 +11 0.13269569 0.2753878 0.3673397 0.16465286 0.9442707 0.19982976 0.8979262 +12 0.29873222 0.3507140 0.5122033 0.08041977 0.9377963 0.13849854 0.9079979 +13 0.33309468 0.3107471 0.5131337 0.06572594 0.9255312 0.11199114 0.8841739 +14 0.64674225 0.1241545 0.2528665 0.15917563 0.8477706 0.06176123 0.6485949 +15 0.64449081 0.1459458 0.3151199 0.17750323 0.8430677 0.05831084 0.7170446 +16 0.66893881 0.1508409 0.3480368 0.15783292 0.8131968 0.03916718 0.6776273 +17 0.03549383 0.2913631 0.3292030 0.25651777 0.9839744 0.27593101 0.8141660 +18 0.18805395 0.2668100 0.3154533 0.17191937 0.9554011 0.20461193 0.8600701 +19 0.14551892 0.1831168 0.4798245 0.36429493 0.9902041 0.11966159 0.8147968 +20 0.62796060 0.1098600 0.3105433 0.21674174 0.8457313 0.03708580 0.6350394 + Vicilath Bracruta Callcusp +1 0.17244420 0.7476589 0.003527337 +2 0.18494940 0.7415172 0.034597921 +3 0.12833142 0.7666969 0.075789630 +4 0.12550967 0.7919786 0.081110164 +5 0.16693075 0.8079786 0.023129027 +6 0.18035860 0.8387650 0.040981168 +7 0.19027523 0.8089116 0.024070054 +8 0.10213052 0.8109194 0.201958942 +9 0.08630413 0.7972178 0.092982775 +10 0.23383453 0.7660374 0.033527777 +11 0.24317802 0.8182692 0.043950322 +12 0.08049055 0.8061715 0.100954127 +13 0.06604026 0.7465509 0.122856392 +14 0.07857237 0.7238162 0.347514804 +15 0.07370069 0.7997141 0.381379395 +16 0.03353260 0.8029953 0.364128496 +17 0.20728700 0.7635487 0.009876543 +18 0.26222869 0.8397471 0.109959916 +19 0.18188455 0.8161275 0.082361157 +20 0.09111967 0.8397124 0.397924041 > ## Uses abundance information. > ## Vector with beals smoothing values corresponding to the first species > ## in dune. > beals(dune, species=1, include=TRUE) - 2 13 4 16 6 1 8 5 -0.5291758 0.2239377 0.5030290 0.1616186 0.3707875 0.4816850 0.2560592 0.4675235 - 17 15 10 11 9 18 3 20 -0.2789116 0.1552083 0.5009997 0.3564815 0.3030290 0.4887566 0.4596520 0.1500000 - 14 19 12 7 -0.1297619 0.2056878 0.2604599 0.3752818 + 1 2 3 4 5 6 7 8 +0.5923077 0.5032372 0.3499038 0.3306953 0.5944041 0.5928780 0.5824352 0.2082532 + 9 10 11 12 13 14 15 16 +0.2960799 0.5462492 0.3659392 0.2610043 0.1982372 0.0922619 0.1140625 0.1066506 + 17 18 19 20 +0.6020408 0.3844577 0.2865741 0.0750000 > > > @@ -1183,9 +1107,10 @@ Number of permutations requested: 999 Max. number of permutations allowed: 9999 Evaluate all permutations?: No. Activation limit: 99 + Response: Distances Df Sum Sq Mean Sq F N.Perm Pr(>F) -Groups 1 0.07931 0.079306 4.6156 999 0.05 * +Groups 1 0.07931 0.079306 4.6156 1000 0.05 * Residuals 22 0.37801 0.017182 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 @@ -1350,12 +1275,13 @@ Permutation type: free Permutation details: - Number of permutations requested: 100 + Number of permutations requested: 999 Max. number of permutations allowed: 9999 Evaluate all permutations?: No. Activation limit: 99 + Response: Distances Df Sum Sq Mean Sq F N.Perm Pr(>F) -Groups 1 0.039979 0.039979 2.4237 100 0.1584 +Groups 1 0.039979 0.039979 2.4237 1000 0.115 Residuals 18 0.296910 0.016495 > anova(mod2) Analysis of Variance Table @@ -1406,13 +1332,14 @@ Permutation type: free Permutation details: - Number of permutations requested: 100 + Number of permutations requested: 999 Max. number of permutations allowed: 9999 Evaluate all permutations?: No. Activation limit: 99 + Response: Distances - Df Sum Sq Mean Sq F N.Perm Pr(>F) -Groups 1 0.033468 0.033468 3.1749 100 0.06931 . -Residuals 18 0.189749 0.010542 + Df Sum Sq Mean Sq F N.Perm Pr(>F) +Groups 1 0.033468 0.033468 3.1749 1000 0.084 . +Residuals 18 0.189749 0.010542 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > anova(mod3) @@ -1659,16 +1586,20 @@ > plot(vare.cap) > anova(vare.cap) Permutation test for capscale under reduced model +Permutation: free +Number of permutations: 999 Model: capscale(formula = varespec ~ N + P + K + Condition(Al), data = varechem, distance = "bray") - Df Var F N.Perm Pr(>F) -Model 3 0.99717 2.2324 199 0.005 ** -Residual 19 2.82904 + Df Variance F Pr(>F) +Model 3 0.99717 2.2324 0.002 ** +Residual 19 2.82904 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > ## Avoid negative eigenvalues with additive constant > capscale(varespec ~ N + P + K + Condition(Al), varechem, + dist="bray", add =TRUE) +Warning in cmdscale(X, k = k, eig = TRUE, add = add) : + only 22 of the first 23 eigenvalues are > 0 Call: capscale(formula = varespec ~ N + P + K + Condition(Al), data = varechem, distance = "bray", add = TRUE) @@ -1900,8 +1831,8 @@ > mod <- cca(dune[1:15,] ~ ., dune.env[1:15,]) > # Look at the names of missing species > attr(mod$CCA$v, "na.action") -Empnig - 2 +Airaprae Empenigr Salirepe + 3 13 24 attr(,"class") [1] "exclude" > # Look at the names of the aliased variables: @@ -2164,51 +2095,51 @@ Species scores: - DCA1 DCA2 DCA3 DCA4 Totals -Cal.vul 0.04119 -1.53268 -2.55101 1.32277 45.07 -Emp.nig 0.09019 0.82274 0.20569 0.30631 151.99 -Led.pal 1.34533 2.47141 -0.34970 -1.13823 8.39 -Vac.myr 1.86298 1.71424 -0.60535 -0.40205 50.71 -Vac.vit 0.16641 0.71095 0.00313 -0.55801 275.03 -Pin.syl -0.73490 1.62050 -1.60275 -2.10199 4.11 -Des.fle 1.97061 1.81651 1.74896 -0.91463 5.60 -Bet.pub 0.79745 3.36374 -0.94546 -1.01741 0.29 -Vac.uli -0.08912 -1.17478 2.86624 0.87025 15.22 -Dip.mon -0.82669 -0.44195 2.58579 -0.38459 3.24 -Dic.sp 2.37743 -0.27373 -0.47099 -1.89036 40.50 -Dic.fus 1.58267 -1.33770 -1.33563 1.47417 113.52 -Dic.pol 0.86689 2.39519 -0.82064 -3.41534 6.06 -Hyl.spl 2.66242 1.19669 1.48288 -0.69978 18.04 -Ple.sch 1.64098 0.15607 0.30044 -0.26717 377.97 -Pol.pil -0.56213 0.14009 0.25198 0.49177 0.61 -Pol.jun 1.22244 -0.89173 0.61287 3.60066 13.85 -Pol.com 1.01545 2.08388 0.06402 0.84199 0.71 -Poh.nut -0.00712 1.09704 -0.82126 -1.59862 2.62 -Pti.cil 0.48093 2.86420 -0.71801 -1.02698 14.01 -Bar.lyc 0.58303 3.71792 -0.84212 -1.88837 3.19 -Cla.arb -0.18554 -1.18973 0.68113 0.55399 255.05 -Cla.ran -0.83427 -0.78085 0.90603 0.70057 388.71 -Cla.ste -1.67768 0.98907 -0.83789 -0.60206 486.71 -Cla.unc 0.97686 -1.70859 -1.68281 -2.26756 56.28 -Cla.coc -0.27221 -0.76713 -0.63836 0.66927 2.79 -Cla.cor 0.29068 -0.97039 0.50414 0.95738 6.22 -Cla.gra 0.21778 -0.41879 0.06530 -0.31472 5.14 -Cla.fim 0.00889 -0.23922 -0.26505 0.33123 3.96 -Cla.cri 0.37774 -1.09161 -0.55627 0.23868 7.47 -Cla.chl -0.91983 1.54955 -0.58109 -1.48643 1.16 -Cla.bot 0.66438 2.19584 -0.90331 -0.91391 0.47 -Cla.ama -0.96418 -0.98992 2.71458 0.52352 0.14 -Cla.sp -1.12318 -0.15330 -0.69833 0.44040 0.52 -Cet.eri 0.27163 -1.28867 -0.81682 -1.93935 3.60 -Cet.isl -0.50158 2.22098 -1.16461 -1.89349 2.03 -Cet.niv -1.67937 -3.67985 4.15644 3.18919 11.85 -Nep.arc 2.18561 -0.82837 0.71958 5.81930 5.26 -Ste.sp -0.78699 -2.01214 2.31212 2.03946 17.52 -Pel.aph 0.45763 -0.34395 0.09916 1.34695 0.76 -Ich.eri 0.04950 -1.97605 1.41509 2.10154 0.22 -Cla.cer -1.21585 -2.30519 2.55186 3.41532 0.10 -Cla.def 0.60517 -1.19771 -0.33388 0.22585 10.23 -Cla.phy -1.53959 1.48574 -1.43209 -1.52387 0.80 + DCA1 DCA2 DCA3 DCA4 Totals +Callvulg 0.04119 -1.53268 -2.55101 1.32277 45.07 +Empenigr 0.09019 0.82274 0.20569 0.30631 151.99 +Rhodtome 1.34533 2.47141 -0.34970 -1.13823 8.39 +Vaccmyrt 1.86298 1.71424 -0.60535 -0.40205 50.71 +Vaccviti 0.16641 0.71095 0.00313 -0.55801 275.03 +Pinusylv -0.73490 1.62050 -1.60275 -2.10199 4.11 +Descflex 1.97061 1.81651 1.74896 -0.91463 5.60 +Betupube 0.79745 3.36374 -0.94546 -1.01741 0.29 +Vacculig -0.08912 -1.17478 2.86624 0.87025 15.22 +Diphcomp -0.82669 -0.44195 2.58579 -0.38459 3.24 +Dicrsp 2.37743 -0.27373 -0.47099 -1.89036 40.50 +Dicrfusc 1.58267 -1.33770 -1.33563 1.47417 113.52 +Dicrpoly 0.86689 2.39519 -0.82064 -3.41534 6.06 +Hylosple 2.66242 1.19669 1.48288 -0.69978 18.04 +Pleuschr 1.64098 0.15607 0.30044 -0.26717 377.97 +Polypili -0.56213 0.14009 0.25198 0.49177 0.61 +Polyjuni 1.22244 -0.89173 0.61287 3.60066 13.85 +Polycomm 1.01545 2.08388 0.06402 0.84199 0.71 +Pohlnuta -0.00712 1.09704 -0.82126 -1.59862 2.62 +Ptilcili 0.48093 2.86420 -0.71801 -1.02698 14.01 +Barbhatc 0.58303 3.71792 -0.84212 -1.88837 3.19 +Cladarbu -0.18554 -1.18973 0.68113 0.55399 255.05 +Cladrang -0.83427 -0.78085 0.90603 0.70057 388.71 +Cladstel -1.67768 0.98907 -0.83789 -0.60206 486.71 +Cladunci 0.97686 -1.70859 -1.68281 -2.26756 56.28 +Cladcocc -0.27221 -0.76713 -0.63836 0.66927 2.79 +Cladcorn 0.29068 -0.97039 0.50414 0.95738 6.22 +Cladgrac 0.21778 -0.41879 0.06530 -0.31472 5.14 +Cladfimb 0.00889 -0.23922 -0.26505 0.33123 3.96 +Cladcris 0.37774 -1.09161 -0.55627 0.23868 7.47 +Cladchlo -0.91983 1.54955 -0.58109 -1.48643 1.16 +Cladbotr 0.66438 2.19584 -0.90331 -0.91391 0.47 +Cladamau -0.96418 -0.98992 2.71458 0.52352 0.14 +Cladsp -1.12318 -0.15330 -0.69833 0.44040 0.52 +Cetreric 0.27163 -1.28867 -0.81682 -1.93935 3.60 +Cetrisla -0.50158 2.22098 -1.16461 -1.89349 2.03 +Flavniva -1.67937 -3.67985 4.15644 3.18919 11.85 +Nepharct 2.18561 -0.82837 0.71958 5.81930 5.26 +Stersp -0.78699 -2.01214 2.31212 2.03946 17.52 +Peltapht 0.45763 -0.34395 0.09916 1.34695 0.76 +Icmaeric 0.04950 -1.97605 1.41509 2.10154 0.22 +Cladcerv -1.21585 -2.30519 2.55186 3.41532 0.10 +Claddefo 0.60517 -1.19771 -0.33388 0.22585 10.23 [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/vegan -r 2827 From noreply at r-forge.r-project.org Tue Jan 7 18:16:40 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 7 Jan 2014 18:16:40 +0100 (CET) Subject: [Vegan-commits] r2828 - in pkg/vegan: R inst Message-ID: <20140107171640.E8D3E185F6C@r-forge.r-project.org> Author: jarioksa Date: 2014-01-07 18:16:40 +0100 (Tue, 07 Jan 2014) New Revision: 2828 Modified: pkg/vegan/R/ordiellipse.R pkg/vegan/R/veganCovEllipse.R pkg/vegan/inst/ChangeLog Log: ordiellipse handles two or more points strictly on line Modified: pkg/vegan/R/ordiellipse.R =================================================================== --- pkg/vegan/R/ordiellipse.R 2014-01-07 08:38:33 UTC (rev 2827) +++ pkg/vegan/R/ordiellipse.R 2014-01-07 17:16:40 UTC (rev 2828) @@ -37,7 +37,7 @@ kk <- complete.cases(pts) for (is in inds) { gr <- out[groups == is & kk] - if (length(gr) > 2) { + if (length(gr) > 1) { X <- pts[gr, ] W <- w[gr] mat <- cov.wt(X, W) Modified: pkg/vegan/R/veganCovEllipse.R =================================================================== --- pkg/vegan/R/veganCovEllipse.R 2014-01-07 08:38:33 UTC (rev 2827) +++ pkg/vegan/R/veganCovEllipse.R 2014-01-07 17:16:40 UTC (rev 2828) @@ -5,5 +5,8 @@ theta <- (0:npoints) * 2 * pi/npoints Circle <- cbind(cos(theta), sin(theta)) ## scale, center and cov must be calculated separately - t(center + scale * t(Circle %*% chol(cov))) + Q <- chol(cov, pivot = TRUE) + ## pivot takes care of cases when points are on a line + o <- attr(Q, "pivot") + t(center + scale * t(Circle %*% Q[,o])) } Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-07 08:38:33 UTC (rev 2827) +++ pkg/vegan/inst/ChangeLog 2014-01-07 17:16:40 UTC (rev 2828) @@ -11,6 +11,15 @@ be used in an incorrect context". The dots were added in r2765, and now removed. + * ordiellipse: failed if all points were on a line. Now handles + these cases by drawing a line trhough the points, and issuing a + warning from chol(): "the matrix is either rank-deficient or + indefinite". Earlier we required at least three points for an + ellipse, but these could still be on a line and fail. Now we + accept two points, and draw the line with a warning. The problem + with three points was reported by Paul Bacquet (Louvain, + Belgium). + * BCI: names checked after http://www.theplantlist.org, but kept the old (alphabetic) order of species. The changes are: Abarema macradenium -> A. macradenia, Apeiba aspera -> A. glabra, From noreply at r-forge.r-project.org Wed Jan 8 10:33:40 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 8 Jan 2014 10:33:40 +0100 (CET) Subject: [Vegan-commits] r2829 - pkg/vegan/R Message-ID: <20140108093340.8DE4A186B19@r-forge.r-project.org> Author: jarioksa Date: 2014-01-08 10:33:40 +0100 (Wed, 08 Jan 2014) New Revision: 2829 Modified: pkg/vegan/R/ordilabel.R Log: fix a warning in R-devel (O.K. in R <= 3.0.1) Modified: pkg/vegan/R/ordilabel.R =================================================================== --- pkg/vegan/R/ordilabel.R 2014-01-07 17:16:40 UTC (rev 2828) +++ pkg/vegan/R/ordilabel.R 2014-01-08 09:33:40 UTC (rev 2829) @@ -31,7 +31,8 @@ else col <- par("fg") col <- rep(col, length=nrow(x))[ord] - border <- rep(border, length=nrow(x))[ord] + if(!is.null(border)) + border <- rep(border, length=nrow(x))[ord] fill <- rep(fill, length=nrow(x))[ord] for (i in 1:nrow(x)) { ordiArgAbsorber(x[i,1] + c(-1,1,1,-1)*w[i], x[i,2] + c(-1,-1,1,1)*h[i], From noreply at r-forge.r-project.org Fri Jan 10 12:03:26 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Jan 2014 12:03:26 +0100 (CET) Subject: [Vegan-commits] r2830 - in pkg/vegan: R inst man Message-ID: <20140110110326.991FC186B68@r-forge.r-project.org> Author: jarioksa Date: 2014-01-10 12:03:26 +0100 (Fri, 10 Jan 2014) New Revision: 2830 Modified: pkg/vegan/R/treedist.R pkg/vegan/R/treedive.R pkg/vegan/inst/ChangeLog pkg/vegan/man/treedive.Rd Log: default now match.force=TRUE and treedive can be silenced Modified: pkg/vegan/R/treedist.R =================================================================== --- pkg/vegan/R/treedist.R 2014-01-08 09:33:40 UTC (rev 2829) +++ pkg/vegan/R/treedist.R 2014-01-10 11:03:26 UTC (rev 2830) @@ -1,5 +1,5 @@ `treedist` <- - function(x, tree, relative = TRUE, match.force = FALSE, ...) + function(x, tree, relative = TRUE, match.force = TRUE, ...) { n <- nrow(x) ABJ <- matrix(0, n , n) Modified: pkg/vegan/R/treedive.R =================================================================== --- pkg/vegan/R/treedive.R 2014-01-08 09:33:40 UTC (rev 2829) +++ pkg/vegan/R/treedive.R 2014-01-10 11:03:26 UTC (rev 2830) @@ -1,17 +1,17 @@ `treedive` <- - function(comm, tree, match.force = FALSE) + function(comm, tree, match.force = TRUE, verbose = TRUE) { if (!inherits(tree, c("hclust", "spantree"))) stop("'clus' must be an 'hclust' or 'spantree' result object") m <- as.matrix(cophenetic(tree)) ## Check tree/comm match by names if (match.force || ncol(comm) != ncol(m)) { - if (match.force) + if (match.force && verbose) message("Forced matching of 'tree' labels and 'comm' names") - else + else if (verbose) message("Dimensions do not match between 'comm' and 'tree'") fnd <- colnames(comm) %in% tree$labels - if (!all(fnd)) { + if (!all(fnd) && verbose) { warning("not all names of 'comm' found in 'tree'") comm <- comm[, fnd] } Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-08 09:33:40 UTC (rev 2829) +++ pkg/vegan/inst/ChangeLog 2014-01-10 11:03:26 UTC (rev 2830) @@ -20,6 +20,10 @@ with three points was reported by Paul Bacquet (Louvain, Belgium). + * treedive, treedist: default is now match.force = TRUE, and + treedive() gained new argument 'verbose' to turn of most messages + -- which is practical in oecosimu(). + * BCI: names checked after http://www.theplantlist.org, but kept the old (alphabetic) order of species. The changes are: Abarema macradenium -> A. macradenia, Apeiba aspera -> A. glabra, Modified: pkg/vegan/man/treedive.Rd =================================================================== --- pkg/vegan/man/treedive.Rd 2014-01-08 09:33:40 UTC (rev 2829) +++ pkg/vegan/man/treedive.Rd 2014-01-10 11:03:26 UTC (rev 2830) @@ -3,7 +3,7 @@ \alias{treeheight} \alias{treedist} -\title{ Functional Diversity and Community Distances from Species Trees} +\title{Functional Diversity and Community Distances from Species Trees} \description{ Functional diversity is defined as the total branch length in a trait dendrogram connecting all species, but excluding @@ -12,9 +12,9 @@ combining two sites. } \usage{ -treedive(comm, tree, match.force = FALSE) +treedive(comm, tree, match.force = TRUE, verbose = TRUE) treeheight(tree) -treedist(x, tree, relative = TRUE, match.force = FALSE, ...) +treedist(x, tree, relative = TRUE, match.force = TRUE, ...) } \arguments{ @@ -26,6 +26,7 @@ matching only happens when dimensions differ (with a warning or message). The order of data must match to the order in \code{tree} if matching by names is not done.} + \item{verbose}{Print diagnostic messages and warnings.} \item{relative}{Use distances relative to the height of combined tree.} \item{\dots}{Other arguments passed to functions (ignored).} } @@ -35,7 +36,8 @@ dendrogram that can be coerced to a correct type using \code{\link{as.hclust}}. When applied to a clustering of species traits, this is a measure of functional diversity (Petchey and Gaston - 2002, 2006). + 2002, 2006), and when applied to phylogenetic trees this is + phylogenetic diversity. Function \code{treedive} finds the \code{treeheight} for each site (row) of a community matrix. The function uses a subset of @@ -45,7 +47,7 @@ calculating \code{\link{cophenetic}} distances from the input dendrogram, then reconstructing the dendrogram for the subset of the cophenetic distance matrix for species occurring in each - site. Diversity is 0 for one spcies, and \code{NA} for empty + site. Diversity is 0 for one species, and \code{NA} for empty communities. Function \code{treedist} finds the dissimilarities among @@ -64,15 +66,17 @@ index attains its maximum value \eqn{2}. The dissimilarity is zero from a combined zero-height tree. - The functions need a dendrogram of species traits as an input. If - species traits contain \code{\link{factor}} or \code{\link{ordered}} - factor variables, it is recommended to use Gower distances for mixed - data (function \code{\link[cluster]{daisy}} in package \pkg{cluster}), - and usually the recommended clustering method is UPGMA - (\code{method = "average"} in function \code{\link{hclust}}) - (Podani and Schmera 2006). + The functions need a dendrogram of species traits or phylogenies as an + input. If species traits contain \code{\link{factor}} or + \code{\link{ordered}} factor variables, it is recommended to use Gower + distances for mixed data (function \code{\link[cluster]{daisy}} in + package \pkg{cluster}), and usually the recommended clustering method + is UPGMA (\code{method = "average"} in function \code{\link{hclust}}) + (Podani and Schmera 2006). Phylogenetic trees can be changed into + dendrograms using \code{\link[ape]{as.hclust.phylo}} (package + \pkg{ape}) - It is possible to analyse the non-randomness of functional diversity + It is possible to analyse the non-randomness of tree diversity using \code{\link{oecosimu}}. This needs specifying an adequate Null model, and the results will change with this choice. } From noreply at r-forge.r-project.org Fri Jan 10 18:07:08 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 10 Jan 2014 18:07:08 +0100 (CET) Subject: [Vegan-commits] r2831 - in pkg/vegan: R inst Message-ID: <20140110170708.6933F186937@r-forge.r-project.org> Author: jarioksa Date: 2014-01-10 18:07:08 +0100 (Fri, 10 Jan 2014) New Revision: 2831 Modified: pkg/vegan/R/cIndexKM.R pkg/vegan/inst/ChangeLog Log: Calinski criterion for one class is now NA instead of Inf, -Inf or NaN Modified: pkg/vegan/R/cIndexKM.R =================================================================== --- pkg/vegan/R/cIndexKM.R 2014-01-10 11:03:26 UTC (rev 2830) +++ pkg/vegan/R/cIndexKM.R 2014-01-10 17:07:08 UTC (rev 2831) @@ -26,7 +26,11 @@ { n <- sum(clsize) k <- length(clsize) - zgss$bgss/(k - 1)/(zgss$wgss/(n - k)) + ## undefined 0/0 for one class (or fewer in error cases) + if (k <= 1) + NA + else + zgss$bgss/(k - 1)/(zgss$wgss/(n - k)) } ################################################ ssi <- function(centers, clsize) Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-10 11:03:26 UTC (rev 2830) +++ pkg/vegan/inst/ChangeLog 2014-01-10 17:07:08 UTC (rev 2831) @@ -11,6 +11,11 @@ be used in an incorrect context". The dots were added in r2765, and now removed. + * cascadeKM: Calinski index for one group will now be NA instead + of randomly chosen Inf, -Inf or NaN which can cause confusion (see + http://stackoverflow.com/questions/21022848/r-produces-different-result-after-io-on-file + + * ordiellipse: failed if all points were on a line. Now handles these cases by drawing a line trhough the points, and issuing a warning from chol(): "the matrix is either rank-deficient or From noreply at r-forge.r-project.org Sun Jan 12 16:56:58 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 12 Jan 2014 16:56:58 +0100 (CET) Subject: [Vegan-commits] r2832 - in pkg/permute: . R inst Message-ID: <20140112155658.6573D18613F@r-forge.r-project.org> Author: jarioksa Date: 2014-01-12 16:56:57 +0100 (Sun, 12 Jan 2014) New Revision: 2832 Modified: pkg/permute/DESCRIPTION pkg/permute/R/setFoo-methods.R pkg/permute/inst/ChangeLog Log: save name of blocks before evaluating list() of blocks Modified: pkg/permute/DESCRIPTION =================================================================== --- pkg/permute/DESCRIPTION 2014-01-10 17:07:08 UTC (rev 2831) +++ pkg/permute/DESCRIPTION 2014-01-12 15:56:57 UTC (rev 2832) @@ -1,6 +1,6 @@ Package: permute Title: Functions for generating restricted permutations of data -Version: 0.8-0 +Version: 0.8-1 Date: $Date$ Authors at R: c(person(given = "Gavin L.", family = "Simpson", email = "ucfagls at gmail.com", Modified: pkg/permute/R/setFoo-methods.R =================================================================== --- pkg/permute/R/setFoo-methods.R 2014-01-10 17:07:08 UTC (rev 2831) +++ pkg/permute/R/setFoo-methods.R 2014-01-12 15:56:57 UTC (rev 2832) @@ -141,10 +141,10 @@ } `setBlocks<-.how` <- function(object, value) { + object[["blocks.name"]] <- deparse(substitute(value)) if (!is.null(value)) value <- as.factor(value) object["blocks"] <- list(value) - object[["blocks.name"]] <- deparse(substitute(value)) object <- fixupCall(object, "blocks", value) object } Modified: pkg/permute/inst/ChangeLog =================================================================== --- pkg/permute/inst/ChangeLog 2014-01-10 17:07:08 UTC (rev 2831) +++ pkg/permute/inst/ChangeLog 2014-01-12 15:56:57 UTC (rev 2832) @@ -2,6 +2,11 @@ permute ChangeLog +Version 0.8-1 + + * setBlocks: get block name before doing anything so that you + really get only name instead of its evaluated value. + Version 0.8-0 * Released to CRAN From noreply at r-forge.r-project.org Sun Jan 12 17:33:53 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 12 Jan 2014 17:33:53 +0100 (CET) Subject: [Vegan-commits] r2833 - pkg/vegan/man Message-ID: <20140112163353.2FB8C186867@r-forge.r-project.org> Author: jarioksa Date: 2014-01-12 17:33:52 +0100 (Sun, 12 Jan 2014) New Revision: 2833 Modified: pkg/vegan/man/prc.Rd Log: prc uses permute capabilities in anova example Modified: pkg/vegan/man/prc.Rd =================================================================== --- pkg/vegan/man/prc.Rd 2014-01-12 15:56:57 UTC (rev 2832) +++ pkg/vegan/man/prc.Rd 2014-01-12 16:33:52 UTC (rev 2833) @@ -109,19 +109,24 @@ \seealso{\code{\link{rda}}, \code{\link{anova.cca}}.} \examples{ -# Chlorpyrifos experiment and experimental design +## Chlorpyrifos experiment and experimental design: Pesticide +## treatment in ditches (replicated) and followed over from 4 weeks +## before to 24 weeks after exposure data(pyrifos) week <- gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24)) dose <- factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11)) +ditch <- gl(12, 1, length=132) # PRC mod <- prc(pyrifos, dose, week) mod # RDA summary(mod) # PRC logabu <- colSums(pyrifos) plot(mod, select = logabu > 100) -# Permutations should be done only within one week, and we only -# are interested on the first axis -anova(mod, strata = week, first=TRUE, perm.max = 100) +## Ditches are randomized, we have a time series, and are only +## interested in the first axis +ctrl <- how(plots = Plots(strata = ditch,type = "free"), + within = Within(type = "series"), nperm = 99) +anova(mod, permutations = ctrl, first=TRUE) } \keyword{ multivariate } From noreply at r-forge.r-project.org Mon Jan 13 09:01:24 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 13 Jan 2014 09:01:24 +0100 (CET) Subject: [Vegan-commits] r2834 - pkg/vegan/man Message-ID: <20140113080124.DFFC3186762@r-forge.r-project.org> Author: jarioksa Date: 2014-01-13 09:01:23 +0100 (Mon, 13 Jan 2014) New Revision: 2834 Modified: pkg/vegan/man/treedive.Rd Log: less verbose use of treedive Modified: pkg/vegan/man/treedive.Rd =================================================================== --- pkg/vegan/man/treedive.Rd 2014-01-12 16:33:52 UTC (rev 2833) +++ pkg/vegan/man/treedive.Rd 2014-01-13 08:01:23 UTC (rev 2834) @@ -127,7 +127,7 @@ ## Significance test using Null model communities. ## The current choice fixes numbers of species and picks species ## proportionally to their overall frequency -oecosimu(dune, treedive, "r1", tree = cl) +oecosimu(dune, treedive, "r1", tree = cl, verbose = FALSE) ## Phylogenetically ordered community table dtree <- treedist(dune, cl) tabasco(dune, hclust(dtree), cl) From noreply at r-forge.r-project.org Mon Jan 13 09:05:27 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 13 Jan 2014 09:05:27 +0100 (CET) Subject: [Vegan-commits] r2835 - in pkg/vegan/tests: . Examples Message-ID: <20140113080527.8C3C41867A7@r-forge.r-project.org> Author: jarioksa Date: 2014-01-13 09:05:26 +0100 (Mon, 13 Jan 2014) New Revision: 2835 Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save pkg/vegan/tests/vegan-tests.Rout.save Log: update tests Modified: pkg/vegan/tests/Examples/vegan-Ex.Rout.save =================================================================== --- pkg/vegan/tests/Examples/vegan-Ex.Rout.save 2014-01-13 08:01:23 UTC (rev 2834) +++ pkg/vegan/tests/Examples/vegan-Ex.Rout.save 2014-01-13 08:05:26 UTC (rev 2835) @@ -1,5 +1,5 @@ -R Under development (unstable) (2014-01-07 r64685) -- "Unsuffered Consequences" +R Under development (unstable) (2014-01-12 r64752) -- "Unsuffered Consequences" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) @@ -162,7 +162,7 @@ Formula: y ~ poly(x1, 1) + poly(x2, 1) - + Total model degrees of freedom 3 REML score: -3.185099 @@ -2627,8 +2627,6 @@ > plot(S, Srare, xlab = "Observed No. of Species", ylab = "Rarefied No. of Species") > abline(0, 1) > rarecurve(BCI, step = 20, sample = raremax, col = "blue", cex = 0.6) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > > > @@ -2820,10 +2818,6 @@ > ordispider(ord, Moisture, col="skyblue") > points(ord, display = "sites", col = as.numeric(Moisture), pch=16) > plot(fit, cex=1.2, axis=TRUE, bg = rgb(1, 1, 1, 0.5)) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > ## Use shorter labels for factor centroids > labels(fit) $vectors @@ -2835,10 +2829,6 @@ > plot(ord) > plot(fit, labels=list(factors = paste("M", c(1,2,4,5), sep = "")), + bg = rgb(1,1,0,0.5)) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > > > @@ -4545,18 +4535,12 @@ > plot(mod, type = "n") > ## Annual succession by ditches > ordiarrows(mod, ditch, label = TRUE) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > ## Show only control and highest Pyrifos treatment > plot(mod, type = "n") > ordiarrows(mod, ditch, label = TRUE, + show.groups = c("2", "3", "5", "11")) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > ordiarrows(mod, ditch, label = TRUE, show = c("6", "9"), + col = 2) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > legend("topright", c("Control", "Pyrifos 44"), lty = 1, col = c(1,2)) > > @@ -4594,8 +4578,6 @@ > plot(mod, type = "n") > pl <- ordihull(mod, Management, scaling = 3) > ordispider(pl, col="red", lty=3, label = TRUE ) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > ## ordispider to connect WA and LC scores > plot(mod, dis=c("wa","lc"), type="p") > ordispider(mod) @@ -4634,12 +4616,8 @@ > ord <- cca(dune) > plot(ord, type = "n") > ordilabel(ord, dis="sites", cex=1.2, font=3, fill="hotpink", col="blue") -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > ## You may prefer separate plots, but here species as well > ordilabel(ord, dis="sp", font=2, priority=colSums(dune)) -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > > > @@ -5068,7 +5046,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE) - + Estimated degrees of freedom: 5.63 total = 6.63 @@ -5085,7 +5063,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE) - + Estimated degrees of freedom: 6.45 total = 7.45 @@ -5116,7 +5094,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE) - + Estimated degrees of freedom: 5.63 total = 6.63 @@ -5131,7 +5109,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "ts", fx = FALSE) - + Estimated degrees of freedom: 4.43 total = 5.43 @@ -5157,7 +5135,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "ds", fx = FALSE) - + Estimated degrees of freedom: 5.63 total = 6.63 @@ -5173,7 +5151,7 @@ Formula: y ~ s(x1, x2, k = 4, bs = "tp", fx = TRUE) - + Estimated degrees of freedom: 3 total = 4 @@ -5190,7 +5168,7 @@ Formula: y ~ te(x1, x2, k = c(4, 4), bs = c("cr", "cr"), fx = c(FALSE, FALSE)) - + Estimated degrees of freedom: 2.99 total = 3.99 @@ -5209,7 +5187,7 @@ Formula: y ~ te(x1, x2, k = c(3, 4), bs = c("cs", "cs"), fx = c(TRUE, TRUE)) - + Estimated degrees of freedom: 11 total = 12 @@ -5353,7 +5331,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE) - + Estimated degrees of freedom: 8.71 total = 9.71 @@ -5366,7 +5344,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE) - + Estimated degrees of freedom: 7.18 total = 8.18 @@ -5379,7 +5357,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE) - + Estimated degrees of freedom: 8.32 total = 9.32 @@ -5865,10 +5843,13 @@ > > ### ** Examples > -> # Chlorpyrifos experiment and experimental design +> ## Chlorpyrifos experiment and experimental design: Pesticide +> ## treatment in ditches (replicated) and followed over from 4 weeks +> ## before to 24 weeks after exposure > data(pyrifos) > week <- gl(11, 12, labels=c(-4, -1, 0.1, 1, 2, 4, 8, 12, 15, 19, 24)) > dose <- factor(rep(c(0.1, 0, 0, 0.9, 0, 44, 6, 0.1, 44, 0.9, 0, 6), 11)) +> ditch <- gl(12, 1, length=132) > # PRC > mod <- prc(pyrifos, dose, week) > mod # RDA @@ -5963,63 +5944,20 @@ 44 0.5704 > logabu <- colSums(pyrifos) > plot(mod, select = logabu > 100) -> # Permutations should be done only within one week, and we only -> # are interested on the first axis -> anova(mod, strata = week, first=TRUE, perm.max = 100) +> ## Ditches are randomized, we have a time series, and are only +> ## interested in the first axis +> ctrl <- how(plots = Plots(strata = ditch,type = "free"), ++ within = Within(type = "series"), nperm = 99) +> anova(mod, permutations = ctrl, first=TRUE) Permutation test for rda under reduced model -Blocks: structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, -Permutation: free -Number of permutations: 999 +Plots: ditch, plot permutation: free +Permutation: series +Number of permutations: 99 -Permutation test for rda under reduced model -Blocks: 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 11L, 11L, -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L), .Label = c("-4", -Permutation: free -Number of permutations: 999 - -Permutation test for rda under reduced model -Blocks: "-1", "0.1", "1", "2", "4", "8", "12", "15", "19", "24"), class = "factor") -Permutation: free -Number of permutations: 999 - Model: prc(response = pyrifos, treatment = dose, time = week) - Df Variance F Pr(>F) -RDA1 1 25.282 15.096 0.001 *** -Residual 77 128.959 + Df Variance F Pr(>F) +RDA1 1 25.282 15.096 0.01 ** +Residual 77 128.959 --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > @@ -6824,8 +6762,6 @@ > ## Add tree to a metric scaling > plot(tr, cmdscale(dis), type = "t") Loading required package: MASS -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > ## Find a configuration to display the tree neatly > plot(tr, type = "t") Initial stress : 0.03111 @@ -6833,8 +6769,6 @@ stress after 20 iters: 0.01139, magic = 0.500 stress after 30 iters: 0.01118, magic = 0.500 stress after 40 iters: 0.01114, magic = 0.500 -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > ## Depths of nodes > depths <- spandepth(tr) > plot(tr, type = "t", label = depths) @@ -6843,8 +6777,6 @@ stress after 20 iters: 0.01139, magic = 0.500 stress after 30 iters: 0.01118, magic = 0.500 stress after 40 iters: 0.01114, magic = 0.500 -Warning in rep(border, length = nrow(x)) : - 'x' is NULL so the result will be NULL > > > @@ -7372,6 +7304,7 @@ > data(dune.phylodis) > cl <- hclust(dune.phylodis) > treedive(dune, cl) +Forced matching of 'tree' labels and 'comm' names 1 2 3 4 5 6 7 8 384.0913 568.8791 1172.9455 1327.9317 1426.9067 1391.1628 1479.5062 1523.0792 9 10 11 12 13 14 15 16 @@ -7381,13 +7314,13 @@ > ## Significance test using Null model communities. > ## The current choice fixes numbers of species and picks species > ## proportionally to their overall frequency -> oecosimu(dune, treedive, "r1", tree = cl) -Warning in oecosimu(dune, treedive, "r1", tree = cl) : +> oecosimu(dune, treedive, "r1", tree = cl, verbose = FALSE) +Warning in oecosimu(dune, treedive, "r1", tree = cl, verbose = FALSE) : nullmodel transformed 'comm' to binary data oecosimu object Call: oecosimu(comm = dune, nestfun = treedive, method = "r1", tree = -cl) +cl, verbose = FALSE) nullmodel method ?r1? with 99 simulations @@ -8009,7 +7942,7 @@ Formula: y ~ s(x1, x2, k = 10, bs = "tp", fx = FALSE) - + Estimated degrees of freedom: 1.28 total = 2.28 @@ -8562,7 +8495,7 @@ > ### > options(digits = 7L) > base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n") -Time elapsed: 39.125 0.116 39.243 0 0 +Time elapsed: 27.424 0.147 27.577 0 0 > grDevices::dev.off() null device 1 Modified: pkg/vegan/tests/vegan-tests.Rout.save =================================================================== --- pkg/vegan/tests/vegan-tests.Rout.save 2014-01-13 08:01:23 UTC (rev 2834) +++ pkg/vegan/tests/vegan-tests.Rout.save 2014-01-13 08:05:26 UTC (rev 2835) @@ -1,6 +1,6 @@ -R Under development (unstable) (2013-11-15 r64218) -- "Unsuffered Consequences" -Copyright (C) 2013 The R Foundation for Statistical Computing +R Under development (unstable) (2014-01-12 r64752) -- "Unsuffered Consequences" +Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -54,186 +54,103 @@ > ### data= argument > ## cca/rda > m <- cca(fla, data=df, na.action=na.exclude, subset = Use != "Pasture" & spno > 7) -> anova(m, perm=100) +> anova(m, permutations=99) Permutation test for cca under reduced model +Permutation: free +Number of permutations: 99 Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Chisq F N.Perm Pr(>F) -Model 6 1.3178 1.3341 99 0.07 . -Residual 4 0.6585 + Df ChiSquare F Pr(>F) +Model 6 1.25838 1.3106 0.07 . +Residual 5 0.80011 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(m, by="term", perm=100) +> ## vegan 2.1-40 cannot handle missing data in next two +> ##anova(m, by="term", permutations=99) +> ##anova(m, by="margin", permutations=99) +> anova(m, by="axis", permutations=99) Permutation test for cca under reduced model -Terms added sequentially (first to last) +Marginal tests for axes +Permutation: free +Number of permutations: 99 -Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Chisq F N.Perm Pr(>F) -Management 3 0.8039 1.6277 99 0.04 * -poly(A1, 2) 2 0.3581 1.0877 99 0.37 -spno 1 0.1558 0.9461 99 0.40 -Residual 4 0.6585 +Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = object$subset) + Df ChiSquare F Pr(>F) +CCA1 1 0.46993 2.9366 0.01 ** +CCA2 1 0.26217 1.6384 0.15 +CCA3 1 0.19308 1.2066 0.29 +CCA4 1 0.18345 1.1464 0.37 +CCA5 1 0.08871 0.5544 0.77 +CCA6 1 0.06104 0.3815 0.90 +Residual 5 0.80011 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(m, by="margin", perm=100) -Permutation test for cca under reduced model -Marginal effects of terms - -Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Chisq F N.Perm Pr(>F) -Management 3 0.6151 1.2454 99 0.31 -poly(A1, 2) 2 0.3514 1.0673 99 0.46 -spno 1 0.1558 0.9461 99 0.58 -Residual 4 0.6585 -> anova(m, by="axis", perm=100) -Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = structure(c(TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE), .Names = c("2", "13", "4", "16", "6", "1", "8", "5", "17", "15", "10", "11", "9", "18", "3", "20", "14", "19", "12", "7"))) - Df Chisq F N.Perm Pr(>F) -CCA1 1 0.4683 2.8448 99 0.05 * -CCA2 1 0.3339 2.0280 99 0.18 -CCA3 1 0.1983 1.2044 99 0.36 -CCA4 1 0.1457 0.8852 99 0.56 -CCA5 1 0.1035 0.6284 99 0.82 -CCA6 1 0.0681 0.4139 99 0.83 -Residual 4 0.6585 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > ## capscale > p <- capscale(fla, data=df, na.action=na.exclude, subset = Use != "Pasture" & spno > 7) -> anova(p, perm=100) +> anova(p, permutations=99) Permutation test for capscale under reduced model +Permutation: free +Number of permutations: 99 Model: capscale(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Var F N.Perm Pr(>F) -Model 6 64.324 1.9652 99 0.01 ** -Residual 4 21.821 + Df Variance F Pr(>F) +Model 6 59.582 1.6462 0.04 * +Residual 5 30.160 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(p, by="term", perm=100) -Permutation test for capscale under reduced model -Terms added sequentially (first to last) - -Model: capscale(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Var F N.Perm Pr(>F) -Management 3 45.520 2.7814 99 0.01 ** -poly(A1, 2) 2 11.342 1.0395 99 0.37 -spno 1 7.462 1.3679 99 0.19 -Residual 4 21.821 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(p, by="margin", perm=100) -Permutation test for capscale under reduced model -Marginal effects of terms - -Model: capscale(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Var F N.Perm Pr(>F) -Management 3 34.092 2.0831 99 0.03 * -poly(A1, 2) 2 10.861 0.9954 99 0.51 -spno 1 7.462 1.3679 99 0.31 -Residual 4 21.821 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(p, by="axis", perm=100) -Model: capscale(formula = dune ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = structure(c(TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE), .Names = c("2", "13", "4", "16", "6", "1", "8", "5", "17", "15", "10", "11", "9", "18", "3", "20", "14", "19", "12", "7"))) - Df Var F N.Perm Pr(>F) -CAP1 1 26.7105 4.8962 99 0.02 * -CAP2 1 17.1633 3.1462 99 0.04 * -CAP3 1 7.7026 1.4119 99 0.31 -CAP4 1 5.9442 1.0896 99 0.50 -CAP5 1 4.0224 0.7373 99 0.59 -CAP6 1 2.7811 0.5098 99 0.87 -Residual 4 21.8213 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 +> ## vegan 2.1-40 cannot hndle missing data in next two +> ##anova(p, by="term", permutations=99) +> ##anova(p, by="margin", permutations=99) +> ##anova(p, by="axis", permutations=99) > ## see that capscale can be updated and also works with 'dist' input > dis <- vegdist(dune) > p <- update(p, dis ~ .) -> anova(p, perm=100) +> anova(p, permutations=99) Permutation test for capscale under reduced model +Permutation: free +Number of permutations: 99 Model: capscale(formula = dis ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Var F N.Perm Pr(>F) -Model 6 1.55041 1.9024 99 0.06 . -Residual 4 0.54333 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(p, by="term", perm=100) -Permutation test for capscale under reduced model -Terms added sequentially (first to last) - -Model: capscale(formula = dis ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Var F N.Perm Pr(>F) -Management 3 1.04714 2.5697 99 0.02 * -poly(A1, 2) 2 0.29810 1.0973 99 0.44 -spno 1 0.20517 1.5105 99 0.21 -Residual 4 0.54333 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(p, by="margin", perm=100) -Permutation test for capscale under reduced model -Marginal effects of terms - -Model: capscale(formula = dis ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = Use != "Pasture" & spno > 7) - Df Var F N.Perm Pr(>F) -Management 3 0.70723 1.7356 99 0.15 -poly(A1, 2) 2 0.27558 1.0144 99 0.44 -spno 1 0.20517 1.5105 99 0.29 -Residual 4 0.54333 -> anova(p, by="axis", perm=100) -Model: capscale(formula = dis ~ Management + poly(A1, 2) + spno, data = df, na.action = na.exclude, subset = structure(c(TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE), .Names = c("2", "13", "4", "16", "6", "1", "8", "5", "17", "15", "10", "11", "9", "18", "3", "20", "14", "19", "12", "7"))) - Df Var F N.Perm Pr(>F) -CAP1 1 0.70878 5.2181 99 0.03 * -CAP2 1 0.54318 3.9989 99 0.07 . -CAP3 1 0.11673 0.8594 99 0.53 -CAP4 1 0.09299 0.6846 99 0.59 -CAP5 1 0.06416 0.4723 99 0.84 -CAP6 1 0.02458 0.1810 99 0.98 -Residual 4 0.54333 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 + Df Variance F Pr(>F) +Model 6 1.54840 1.6423 0.1 +Residual 5 0.78568 +> ## vegan 2.1-40 cannot handle missing data in next three +> ##anova(p, by="term", permutations=99) +> ##anova(p, by="margin", permutations=99) +> ##anova(p, by="axis", permutations=99) > ### attach()ed data frame instead of data= > attach(df) > q <- cca(fla, na.action = na.omit, subset = Use != "Pasture" & spno > 7) -> anova(q, perm=100) +> anova(q, permutations=99) Permutation test for cca under reduced model +Permutation: free +Number of permutations: 99 Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, na.action = na.omit, subset = Use != "Pasture" & spno > 7) - Df Chisq F N.Perm Pr(>F) -Model 6 1.3178 1.3341 99 0.17 -Residual 4 0.6585 -> anova(q, by="term", perm=100) + Df ChiSquare F Pr(>F) +Model 6 1.25838 1.3106 0.11 +Residual 5 0.80011 +> ## commented tests below fail in vegan 2.1-40 because number of +> ## observations changes +> ##anova(q, by="term", permutations=99) +> ##anova(q, by="margin", permutations=99) +> anova(q, by="axis", permutations=99) Permutation test for cca under reduced model -Terms added sequentially (first to last) +Marginal tests for axes +Permutation: free +Number of permutations: 99 -Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, na.action = na.omit, subset = Use != "Pasture" & spno > 7) - Df Chisq F N.Perm Pr(>F) -Management 3 0.8039 1.6277 99 0.03 * -poly(A1, 2) 2 0.3581 1.0877 99 0.36 -spno 1 0.1558 0.9461 99 0.43 -Residual 4 0.6585 +Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, na.action = na.omit, subset = object$subset) + Df ChiSquare F Pr(>F) +CCA1 1 0.46993 2.9366 0.03 * +CCA2 1 0.26217 1.6384 0.13 +CCA3 1 0.19308 1.2066 0.34 +CCA4 1 0.18345 1.1464 0.42 +CCA5 1 0.08871 0.5544 0.75 +CCA6 1 0.06104 0.3815 0.94 +Residual 5 0.80011 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 -> anova(q, by="margin", perm=100) -Permutation test for cca under reduced model -Marginal effects of terms - -Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, na.action = na.omit, subset = Use != "Pasture" & spno > 7) - Df Chisq F N.Perm Pr(>F) -Management 3 0.6151 1.2454 99 0.35 -poly(A1, 2) 2 0.3514 1.0673 99 0.44 -spno 1 0.1558 0.9461 99 0.51 -Residual 4 0.6585 -> anova(q, by="axis", perm=100) -Model: cca(formula = dune ~ Management + poly(A1, 2) + spno, na.action = na.omit, subset = structure(c(TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE), .Names = c("2", "13", "4", "16", "6", "1", "8", "5", "17", "15", "10", "11", "9", "18", "3", "20", "14", "19", "12", "7"))) - Df Chisq F N.Perm Pr(>F) -CCA1 1 0.4683 2.8448 99 0.07 . -CCA2 1 0.3339 2.0280 99 0.11 -CCA3 1 0.1983 1.2044 99 0.25 -CCA4 1 0.1457 0.8852 99 0.50 -CCA5 1 0.1035 0.6284 99 0.59 -CCA6 1 0.0681 0.4139 99 0.75 -Residual 4 0.6585 ---- -Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > ### Check that constrained ordination functions can be embedded. > ### The data.frame 'df' is still attach()ed. > foo <- function(bar, Y, X, ...) @@ -245,90 +162,90 @@ Call: cca(formula = Y ~ X, na.action = ..1) Inertia Proportion Rank -Total 2.1037 1.0000 -Constrained 0.5887 0.2798 3 -Unconstrained 1.5150 0.7202 14 +Total 2.0949 1.0000 +Constrained 0.6236 0.2977 3 +Unconstrained 1.4713 0.7023 14 Inertia is mean squared contingency coefficient 2 observations deleted due to missingness Eigenvalues for constrained axes: - CCA1 CCA2 CCA3 -0.3327 0.1748 0.0812 + CCA1 CCA2 CCA3 +0.31573 0.20203 0.10584 Eigenvalues for unconstrained axes: CA1 CA2 CA3 CA4 CA5 CA6 CA7 CA8 CA9 CA10 CA11 -0.4595 0.2168 0.1746 0.1409 0.1155 0.0865 0.0778 0.0669 0.0532 0.0431 0.0356 +0.4478 0.1910 0.1788 0.1409 0.1202 0.0949 0.0732 0.0570 0.0531 0.0448 0.0312 CA12 CA13 CA14 -0.0265 0.0129 0.0052 +0.0181 0.0104 0.0098 > foo("rda", dune, Management, na.action = na.omit) Call: rda(formula = Y ~ X, na.action = ..1) Inertia Proportion Rank -Total 81.8300 1.0000 -Constrained 28.0900 0.3433 3 -Unconstrained 53.7400 0.6567 14 +Total 85.1200 1.0000 +Constrained 32.7800 0.3851 3 +Unconstrained 52.3400 0.6149 14 Inertia is variance 2 observations deleted due to missingness Eigenvalues for constrained axes: RDA1 RDA2 RDA3 -15.661 9.697 2.736 +15.956 13.621 3.199 Eigenvalues for unconstrained axes: PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PC10 PC11 -16.267 8.125 6.319 5.181 3.665 3.438 2.654 2.359 1.892 1.415 0.993 +14.893 9.136 6.042 5.674 3.638 2.865 2.504 1.968 1.888 1.239 0.959 PC12 PC13 PC14 - 0.665 0.419 0.350 + 0.779 0.501 0.255 > foo("capscale", dune, Management, dist="jaccard", na.action = na.omit) Call: bar(formula = Y ~ X, distance = "jaccard", na.action = ..2) Inertia Proportion Rank -Total 5.2930 1.0000 -Constrained 1.5460 0.2921 3 -Unconstrained 3.7470 0.7079 14 +Total 5.1430 1.0000 +Constrained 1.6450 0.3199 3 +Unconstrained 3.4980 0.6801 14 Inertia is squared Jaccard distance 2 observations deleted due to missingness Eigenvalues for constrained axes: CAP1 CAP2 CAP3 -0.8856 0.4712 0.1893 +0.8504 0.6047 0.1902 Eigenvalues for unconstrained axes: MDS1 MDS2 MDS3 MDS4 MDS5 MDS6 MDS7 MDS8 MDS9 MDS10 MDS11 -1.1647 0.5426 0.4475 0.3394 0.2945 0.2062 0.1759 0.1531 0.1168 0.0885 0.0876 +1.0474 0.4406 0.4386 0.4054 0.2847 0.1947 0.1546 0.1506 0.0957 0.0935 0.0761 MDS12 MDS13 MDS14 -0.0743 0.0475 0.0086 +0.0603 0.0436 0.0120 > foo("capscale", vegdist(dune), Management, na.action = na.omit) Call: bar(formula = Y ~ X, na.action = ..1) Inertia Proportion Rank -Total 3.9490 -Real Total 4.1690 1.0000 -Constrained 1.3490 0.3235 3 -Unconstrained 2.8200 0.6765 12 -Imaginary -0.2200 5 +Total 3.765 +Real Total 3.949 1.000 +Constrained 1.446 0.366 3 +Unconstrained 2.504 0.634 13 +Imaginary -0.184 4 Inertia is squared Bray distance 2 observations deleted due to missingness Eigenvalues for constrained axes: CAP1 CAP2 CAP3 -0.8665 0.3747 0.1076 +0.7910 0.5497 0.1050 Eigenvalues for unconstrained axes: MDS1 MDS2 MDS3 MDS4 MDS5 MDS6 MDS7 MDS8 MDS9 MDS10 MDS11 -1.2509 0.4808 0.3715 0.2352 0.1611 0.0967 0.0714 0.0689 0.0366 0.0299 0.0135 - MDS12 -0.0036 +1.0756 0.3691 0.3349 0.2695 0.1651 0.0931 0.0726 0.0673 0.0286 0.0174 0.0093 + MDS12 MDS13 +0.0011 0.0001 > ### FIXME: foo("capscale", dune, Management, data=dune.env) fails! > ### > detach(df) > ### Check that statistics match in partial constrained ordination > m <- cca(dune ~ A1 + Moisture + Condition(Management), dune.env, subset = A1 > 3) -> tab <- anova(m, by = "axis", perm.max = 100) +> tab <- anova(m, by = "axis", permutations = 99) > m Call: cca(formula = dune ~ A1 + Moisture + Condition(Management), data = dune.env, subset = A1 > 3) @@ -349,13 +266,18 @@ 0.31042 0.13634 0.11974 0.09408 0.07763 0.06425 0.04449 0.02925 0.02785 0.01299 > tab -Model: cca(formula = dune ~ A1 + Moisture + Condition(Management), data = dune.env, subset = c(TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE)) - Df Chisq F N.Perm Pr(>F) -CCA1 1 0.2711 2.9561 99 0.01 ** -CCA2 1 0.1406 1.5329 99 0.05 * -CCA3 1 0.0876 0.9553 99 0.42 -CCA4 1 0.0562 0.6132 99 0.75 -Residual 10 0.9170 +Permutation test for cca under reduced model +Marginal tests for axes +Permutation: free +Number of permutations: 99 + +Model: cca(formula = dune ~ A1 + Moisture + Condition(Management), data = dune.env, subset = object$subset) + Df ChiSquare F Pr(>F) +CCA1 1 0.27109 2.9561 0.02 * +CCA2 1 0.14057 1.5329 0.29 +CCA3 1 0.08761 0.9553 0.74 +CCA4 1 0.05624 0.6132 0.92 +Residual 10 0.91705 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > all.equal(tab[,2], c(m$CCA$eig, m$CA$tot.chi), check.attributes=FALSE) @@ -381,82 +303,114 @@ > # partial db-RDA > cap.model.cond <- capscale(X ~ A + B + Condition(CC)) > anova(cap.model.cond, by="axis", strata=CC) # -> error pre r2287 +Permutation test for capscale under reduced model +Marginal tests for axes +Blocks: strata +Permutation: free +Number of permutations: 999 + Model: capscale(formula = X ~ A + B + Condition(CC)) - Df Var F N.Perm Pr(>F) -CAP1 1 0.2682 1.3075 99 0.22 -CAP2 1 0.0685 0.3339 99 0.95 -CAP3 1 0.0455 0.2217 99 0.94 -Residual 22 4.5130 + Df Variance F Pr(>F) +CAP1 1 0.2682 1.3075 0.242 +CAP2 1 0.0685 0.3339 0.921 +CAP3 1 0.0455 0.2217 0.966 +Residual 22 4.5130 > anova(cap.model.cond, by="terms", strata=CC) # -> error pre r2287 Permutation test for capscale under reduced model Terms added sequentially (first to last) -Permutations stratified within 'CC' +Blocks: strata +Permutation: free +Number of permutations: 999 Model: capscale(formula = X ~ A + B + Condition(CC)) - Df Var F N.Perm Pr(>F) -A 1 0.1316 0.6415 99 0.71 -B 2 0.2506 0.6108 99 0.84 -Residual 22 4.5130 + Df Variance F Pr(>F) +A 1 0.1316 0.6415 0.680 +B 2 0.2506 0.6108 0.824 +Residual 22 4.5130 > > # db-RDA without conditional factor > cap.model <- capscale(X ~ A + B) > anova(cap.model, by="axis", strata=CC) # -> no error +Permutation test for capscale under reduced model +Marginal tests for axes +Blocks: strata +Permutation: free +Number of permutations: 999 + Model: capscale(formula = X ~ A + B) - Df Var F N.Perm Pr(>F) -CAP1 1 0.2682 1.3267 99 0.25 -CAP2 1 0.0685 0.3388 99 0.95 -CAP3 1 0.0455 0.2249 99 0.98 -Residual 26 5.2565 + Df Variance F Pr(>F) +CAP1 1 0.2682 1.3267 0.240 +CAP2 1 0.0685 0.3388 0.913 +CAP3 1 0.0455 0.2249 0.964 +Residual 26 5.2565 > anova(cap.model, by="terms", strata=CC) # -> no error Permutation test for capscale under reduced model Terms added sequentially (first to last) -Permutations stratified within 'CC' +Blocks: strata +Permutation: free +Number of permutations: 999 Model: capscale(formula = X ~ A + B) - Df Var F N.Perm Pr(>F) -A 1 0.1316 0.6509 99 0.65 -B 2 0.2506 0.6198 99 0.84 -Residual 26 5.2565 + Df Variance F Pr(>F) +A 1 0.1316 0.6509 0.693 +B 2 0.2506 0.6198 0.829 +Residual 26 5.2565 > > # partial RDA > rda.model.cond <- rda(X ~ A + B + Condition(CC)) > anova(rda.model.cond, by="axis", strata=CC) # -> no error +Permutation test for rda under reduced model +Marginal tests for axes +Blocks: strata +Permutation: free +Number of permutations: 999 + Model: rda(formula = X ~ A + B + Condition(CC)) - Df Var F N.Perm Pr(>F) -RDA1 1 0.2682 1.3075 99 0.31 -RDA2 1 0.0685 0.3339 99 0.85 -RDA3 1 0.0455 0.2217 99 0.98 -Residual 22 4.5130 + Df Variance F Pr(>F) +RDA1 1 0.2682 1.3075 0.286 +RDA2 1 0.0685 0.3339 0.921 +RDA3 1 0.0455 0.2217 0.963 +Residual 22 4.5130 > anova(rda.model.cond, by="terms", strata=CC) # -> error pre r2287 Permutation test for rda under reduced model Terms added sequentially (first to last) -Permutations stratified within 'CC' +Blocks: strata +Permutation: free +Number of permutations: 999 Model: rda(formula = X ~ A + B + Condition(CC)) - Df Var F N.Perm Pr(>F) -A 1 0.1316 0.6415 99 0.63 -B 2 0.2506 0.6108 99 0.80 -Residual 22 4.5130 + Df Variance F Pr(>F) +A 1 0.1316 0.6415 0.669 +B 2 0.2506 0.6108 0.827 +Residual 22 4.5130 > > # RDA without conditional factor [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/vegan -r 2835 From noreply at r-forge.r-project.org Tue Jan 14 13:13:28 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 14 Jan 2014 13:13:28 +0100 (CET) Subject: [Vegan-commits] r2836 - in pkg/vegan: data inst man Message-ID: <20140114121328.A41C5184FA5@r-forge.r-project.org> Author: jarioksa Date: 2014-01-14 13:13:28 +0100 (Tue, 14 Jan 2014) New Revision: 2836 Modified: pkg/vegan/data/dune.taxon.rda pkg/vegan/inst/ChangeLog pkg/vegan/man/dune.taxon.Rd Log: update dune.taxon to APG III Modified: pkg/vegan/data/dune.taxon.rda =================================================================== (Binary files differ) Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-13 08:05:26 UTC (rev 2835) +++ pkg/vegan/inst/ChangeLog 2014-01-14 12:13:28 UTC (rev 2836) @@ -60,6 +60,8 @@ al. 2014, Nature doi:10.1038/nature12872, published online Dec 22, 2013). + dune.taxon was updated to APG III. + * varespec: use 4+4 letter CEP names instead of 3+dot+3. Nomenclature was cautiously fixed. Most important changes: Ledum palustre -> Rhododendron tomentosum (Led.pal -> Rhodtome), Modified: pkg/vegan/man/dune.taxon.Rd =================================================================== --- pkg/vegan/man/dune.taxon.Rd 2014-01-13 08:05:26 UTC (rev 2835) +++ pkg/vegan/man/dune.taxon.Rd 2014-01-14 12:13:28 UTC (rev 2836) @@ -22,13 +22,13 @@ } \details{ - The classification of vascular plants is adapted from AGP (2003), and + The classification of vascular plants is based on APG (2009), and that of mosses from Hill et al. (2006). } \references{ - AGP [Angiosperm Phylogeny Group] (2003) An update of the Angiosperm + APG [Angiosperm Phylogeny Group] (2009) An update of the Angiosperm Phylogeny Group classification for the orders and families of flowering - plants: AGP II. \emph{Bot. J. Linnean Soc.} \strong{141}: 399--436. + plants: APG III. \emph{Bot. J. Linnean Soc.} \strong{161}: 105--121. Hill, M.O et al. (2006) An annotated checklist of the mosses of Europe and Macaronesia. \emph{J. Bryology} \strong{28}: 198--267. From noreply at r-forge.r-project.org Tue Jan 21 12:53:12 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 21 Jan 2014 12:53:12 +0100 (CET) Subject: [Vegan-commits] r2837 - in pkg/vegan: R inst Message-ID: <20140121115312.4C41F1867ED@r-forge.r-project.org> Author: jarioksa Date: 2014-01-21 12:53:11 +0100 (Tue, 21 Jan 2014) New Revision: 2837 Modified: pkg/vegan/R/biplot.rda.R pkg/vegan/inst/ChangeLog Log: rda biplot failed with NA scores (like with negative 'scaling' and zero variance species) Modified: pkg/vegan/R/biplot.rda.R =================================================================== --- pkg/vegan/R/biplot.rda.R 2014-01-14 12:13:28 UTC (rev 2836) +++ pkg/vegan/R/biplot.rda.R 2014-01-21 11:53:11 UTC (rev 2837) @@ -31,9 +31,9 @@ if(length(type) < 2) type <- rep(type, 2) if (missing(xlim)) - xlim <- range(g$species[, 1], g$sites[, 1]) + xlim <- range(g$species[, 1], g$sites[, 1], na.rm = TRUE) if (missing(ylim)) - ylim <- range(g$species[, 2], g$sites[, 2]) + ylim <- range(g$species[, 2], g$sites[, 2], na.rm = TRUE) plot(g[[1]], xlim = xlim, ylim = ylim, type = "n", asp = 1, ...) abline(h = 0, lty = 3) Modified: pkg/vegan/inst/ChangeLog =================================================================== --- pkg/vegan/inst/ChangeLog 2014-01-14 12:13:28 UTC (rev 2836) +++ pkg/vegan/inst/ChangeLog 2014-01-21 11:53:11 UTC (rev 2837) @@ -11,11 +11,14 @@ be used in an incorrect context". The dots were added in r2765, and now removed. + * biplot.rda: failed in axis scaling with negative 'scaling' + values when some species had zero variance (and hence species + scores was 0/0 = NaN). + * cascadeKM: Calinski index for one group will now be NA instead of randomly chosen Inf, -Inf or NaN which can cause confusion (see http://stackoverflow.com/questions/21022848/r-produces-different-result-after-io-on-file - * ordiellipse: failed if all points were on a line. Now handles these cases by drawing a line trhough the points, and issuing a warning from chol(): "the matrix is either rank-deficient or From noreply at r-forge.r-project.org Thu Jan 23 17:11:23 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 23 Jan 2014 17:11:23 +0100 (CET) Subject: [Vegan-commits] r2838 - in pkg/permute: . R inst Message-ID: <20140123161123.BB7D81846E6@r-forge.r-project.org> Author: gsimpson Date: 2014-01-23 17:11:23 +0100 (Thu, 23 Jan 2014) New Revision: 2838 Modified: pkg/permute/DESCRIPTION pkg/permute/R/allPerms.R pkg/permute/inst/ChangeLog Log: allPerms was not using the original row indices in the case of random permutation within blocks Modified: pkg/permute/DESCRIPTION =================================================================== --- pkg/permute/DESCRIPTION 2014-01-21 11:53:11 UTC (rev 2837) +++ pkg/permute/DESCRIPTION 2014-01-23 16:11:23 UTC (rev 2838) @@ -1,6 +1,6 @@ Package: permute Title: Functions for generating restricted permutations of data -Version: 0.8-1 +Version: 0.8-2 Date: $Date$ Authors at R: c(person(given = "Gavin L.", family = "Simpson", email = "ucfagls at gmail.com", Modified: pkg/permute/R/allPerms.R =================================================================== --- pkg/permute/R/allPerms.R 2014-01-21 11:53:11 UTC (rev 2837) +++ pkg/permute/R/allPerms.R 2014-01-23 16:11:23 UTC (rev 2838) @@ -109,6 +109,9 @@ series = allSeries(n, nperms, mirrorW), grid = allGrid(n, nperms, dimW[1], dimW[2], mirrorW, constantW)) + ## use res to index the original observation indices in + ## this group + res[] <- obs[res] } else { ## permuting within plots tab <- table(strataP) Modified: pkg/permute/inst/ChangeLog =================================================================== --- pkg/permute/inst/ChangeLog 2014-01-21 11:53:11 UTC (rev 2837) +++ pkg/permute/inst/ChangeLog 2014-01-23 16:11:23 UTC (rev 2838) @@ -2,6 +2,13 @@ permute ChangeLog +Version 0.8-2 + + * allPerms: with free permutations *within* blocks, `allPerms()` + was not returning the indices in the original data but in the + permutation indices within block. + Reported by: Joris Meys + Version 0.8-1 * setBlocks: get block name before doing anything so that you From noreply at r-forge.r-project.org Thu Jan 23 19:11:45 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 23 Jan 2014 19:11:45 +0100 (CET) Subject: [Vegan-commits] r2839 - in pkg/permute: R inst Message-ID: <20140123181145.54101183EE7@r-forge.r-project.org> Author: gsimpson Date: 2014-01-23 19:11:45 +0100 (Thu, 23 Jan 2014) New Revision: 2839 Added: pkg/permute/R/cbindAllPerms.R Modified: pkg/permute/R/allPerms.R pkg/permute/inst/ChangeLog Log: to complete r2838, allPerms needs to expand.grid, matrix-wise each within-block permutation matrix Modified: pkg/permute/R/allPerms.R =================================================================== --- pkg/permute/R/allPerms.R 2014-01-23 16:11:23 UTC (rev 2838) +++ pkg/permute/R/allPerms.R 2014-01-23 18:11:45 UTC (rev 2839) @@ -60,9 +60,12 @@ nperms = nperms) } + ## bind all blocks together, repeating them as required + out <- cbindAllPerms(out) + ## bind all the blocks together - out <- do.call(cbind, out) ## hmm are any of these the same shape? - out[, unlist(spl)] <- out + ## out <- do.call(cbind, out) ## hmm are any of these the same shape? + ##out[, unlist(spl)] <- out ## is this being done at the doAllPerms level? if(!(observed <- getObserved(control))) { obs.v <- seq_len(n) @@ -72,7 +75,7 @@ ## observed ordering setNperm(control) <- getNperm(control) - 1 } - class(out) <- "allPerms" + class(out) <- c("allPerms", "matrix") attr(out, "control") <- control attr(out, "observed") <- observed out Added: pkg/permute/R/cbindAllPerms.R =================================================================== --- pkg/permute/R/cbindAllPerms.R (rev 0) +++ pkg/permute/R/cbindAllPerms.R 2014-01-23 18:11:45 UTC (rev 2839) @@ -0,0 +1,22 @@ +##' @title Replicate and cbind all block-level permutations +##' @param x a list whose compontents are the set of all permutations +##' at the block level +##' @return a matrix +##' @author Gavin L. Simpson +`cbindAllPerms` <- function(x) { + nb <- length(x) ## number of blocks + + ## prepares nb seqence vectors 1:`obs in block` for expand.grid + rowind <- do.call(expand.grid, lapply(x, function(i) seq_len(nrow(i)))) + + ## contains row indices for each block, but 1st block varies fastest + ## and allPerms() traditionally had nth block varying fastest, so + ## reverse order of columns. drop ensures this work if only 1 block. + rowind <- rowind[, seq.int(nb, 1), drop = FALSE] + + ## index elements of x using the row indices - gives a list to cbind + ## next. sapply() over-simplifies to wrong dimensions so not used + out <- lapply(seq_len(nb), function(i, m, ind) m[[i]][ind[, i] ,], + m = x, ind = rowind) + do.call(cbind, out) ## returns +} Modified: pkg/permute/inst/ChangeLog =================================================================== --- pkg/permute/inst/ChangeLog 2014-01-23 16:11:23 UTC (rev 2838) +++ pkg/permute/inst/ChangeLog 2014-01-23 18:11:45 UTC (rev 2839) @@ -7,6 +7,12 @@ * allPerms: with free permutations *within* blocks, `allPerms()` was not returning the indices in the original data but in the permutation indices within block. + + In addition, `allPerms()` was not replicating each row in a + within-block permutation matrix for all the rows in the other + block within-block permutation matrices. This is now achieved via + a new, non-exported utility function `cbindAllPerms()`. + Reported by: Joris Meys Version 0.8-1 From noreply at r-forge.r-project.org Sun Jan 26 03:15:23 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 26 Jan 2014 03:15:23 +0100 (CET) Subject: [Vegan-commits] r2840 - pkg/permute/inst/tests Message-ID: <20140126021525.171E8184AD5@r-forge.r-project.org> Author: gsimpson Date: 2014-01-26 03:15:18 +0100 (Sun, 26 Jan 2014) New Revision: 2840 Added: pkg/permute/inst/tests/test-allPerms.R Log: add unit tests for allPerms Added: pkg/permute/inst/tests/test-allPerms.R =================================================================== --- pkg/permute/inst/tests/test-allPerms.R (rev 0) +++ pkg/permute/inst/tests/test-allPerms.R 2014-01-26 02:15:18 UTC (rev 2840) @@ -0,0 +1,52 @@ +library(testthat) +library_if_available(permute) + +context("Testing allPerms()") + +## test that allPerms returns +test_that("allPerms - blocks - within block free", { + ## example data from Joris Meys from + ## http://stackoverflow.com/a/21313632/429846 + thedata <- data.frame(score = c(replicate(4, sample(1:3))), + judge = rep(1:4, each = 3), + wine = rep.int(1:3, 4)) + + ## without the observed permutation included + hh <- how(within = Within("free"), + blocks = factor(thedata$judge), + complete = TRUE, maxperm = 1e9) + nr <- nrow(thedata) + np <- numPerms(nr, hh) + p <- allPerms(nr, control = hh) + expect_that(nrow(p), equals(np - 1)) ## default is to drop observed + + ## with the observed permutation included + hh <- how(within = Within("free"), + blocks = factor(thedata$judge), + complete = TRUE, maxperm = 1e9, + observed = TRUE) + p <- allPerms(nr, control = hh) + expect_that(nrow(p), equals(np)) ## now includes observed +}) + +test_that("allPerms - blocks - within block free - uneven block sizes", { + fac <- factor(rep(1:3, times = c(2,2,4))) + + ## without the observed permutation included + hh <- how(within = Within("free"), + blocks = fac, + complete = TRUE, maxperm = 1e9) + ll <- length(fac) + np <- numPerms(ll, hh) + expect_that(np, equals(prod(factorial(2), factorial(2), factorial(4)))) + p <- allPerms(ll, control = hh) + expect_that(nrow(p), equals(np - 1)) ## default is to drop observed + + ## with the observed permutation included + hh <- how(within = Within("free"), + blocks = fac, + complete = TRUE, maxperm = 1e9, + observed = TRUE) + p <- allPerms(ll, control = hh) + expect_that(nrow(p), equals(np)) ## now includes observed +}) From noreply at r-forge.r-project.org Sun Jan 26 03:18:48 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 26 Jan 2014 03:18:48 +0100 (CET) Subject: [Vegan-commits] r2841 - pkg/permute/R Message-ID: <20140126021848.45402186716@r-forge.r-project.org> Author: gsimpson Date: 2014-01-26 03:18:45 +0100 (Sun, 26 Jan 2014) New Revision: 2841 Modified: pkg/permute/R/cbindAllPerms.R Log: getting the block indices to vary slowest with first block to fastest for last block needed rethinking. Fix allows this to work for even and uneven sized blocks. Modified: pkg/permute/R/cbindAllPerms.R =================================================================== --- pkg/permute/R/cbindAllPerms.R 2014-01-26 02:15:18 UTC (rev 2840) +++ pkg/permute/R/cbindAllPerms.R 2014-01-26 02:18:45 UTC (rev 2841) @@ -6,17 +6,20 @@ `cbindAllPerms` <- function(x) { nb <- length(x) ## number of blocks + ## allPerms has first block varying slowest, but expand.grid has + ## first factor varying fastest. Hence we reverse `x` here, and + ## also reverse `out` back again later + x <- rev(x) + ## prepares nb seqence vectors 1:`obs in block` for expand.grid - rowind <- do.call(expand.grid, lapply(x, function(i) seq_len(nrow(i)))) + rowind <- do.call(expand.grid, + lapply(x, function(i) seq_len(nrow(i)))) - ## contains row indices for each block, but 1st block varies fastest - ## and allPerms() traditionally had nth block varying fastest, so - ## reverse order of columns. drop ensures this work if only 1 block. - rowind <- rowind[, seq.int(nb, 1), drop = FALSE] - ## index elements of x using the row indices - gives a list to cbind - ## next. sapply() over-simplifies to wrong dimensions so not used - out <- lapply(seq_len(nb), function(i, m, ind) m[[i]][ind[, i] ,], - m = x, ind = rowind) - do.call(cbind, out) ## returns + ## next. sapply() over-simplifies to wrong dimensions so not used. + ## Note: the lapply() result is reversed with `rev` to undo the reversing + ## of `x` earlier; ensures everything is correct block order. + out <- rev(lapply(seq_len(nb), function(i, m, ind) m[[i]][ind[, i] ,], + m = x, ind = rowind)) + do.call(cbind, out) ## return } From noreply at r-forge.r-project.org Sun Jan 26 20:20:03 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 26 Jan 2014 20:20:03 +0100 (CET) Subject: [Vegan-commits] r2842 - pkg/permute/inst/tests Message-ID: <20140126192003.A00991856AF@r-forge.r-project.org> Author: gsimpson Date: 2014-01-26 20:20:03 +0100 (Sun, 26 Jan 2014) New Revision: 2842 Modified: pkg/permute/inst/tests/test-allPerms.R Log: Unit tests extended: check for unique permutations in allPerms; check Plot-level permutations. Modified: pkg/permute/inst/tests/test-allPerms.R =================================================================== --- pkg/permute/inst/tests/test-allPerms.R 2014-01-26 02:18:45 UTC (rev 2841) +++ pkg/permute/inst/tests/test-allPerms.R 2014-01-26 19:20:03 UTC (rev 2842) @@ -3,7 +3,6 @@ context("Testing allPerms()") -## test that allPerms returns test_that("allPerms - blocks - within block free", { ## example data from Joris Meys from ## http://stackoverflow.com/a/21313632/429846 @@ -20,6 +19,10 @@ p <- allPerms(nr, control = hh) expect_that(nrow(p), equals(np - 1)) ## default is to drop observed + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, info = "Blocks: even; within: free; no observed") + ## with the observed permutation included hh <- how(within = Within("free"), blocks = factor(thedata$judge), @@ -27,6 +30,10 @@ observed = TRUE) p <- allPerms(nr, control = hh) expect_that(nrow(p), equals(np)) ## now includes observed + + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, info = "Blocks: even; within: free; observed") }) test_that("allPerms - blocks - within block free - uneven block sizes", { @@ -42,6 +49,10 @@ p <- allPerms(ll, control = hh) expect_that(nrow(p), equals(np - 1)) ## default is to drop observed + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, info = "Blocks: uneven; within: free; no observed") + ## with the observed permutation included hh <- how(within = Within("free"), blocks = fac, @@ -49,4 +60,26 @@ observed = TRUE) p <- allPerms(ll, control = hh) expect_that(nrow(p), equals(np)) ## now includes observed + + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, info = "Blocks: uneven; within: free; observed") }) + +## testing plot-level permutations ------------------------------------ +test_that("allPerms: plots; within: free; even: yes;", { + fac <- rep(1:3, each = 3) + + hh <- how(plots = Plots(strata = fac), + complete = TRUE, maxperm = 1e9) + ll <- length(fac) + np <- numPerms(ll, hh) + p <- allPerms(ll, control = hh) + expect_that(nrow(p), equals(np - 1), ## default is to drop observed + info = "Check n all perms == numPerms output.") + + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, + info = "Checking Unique: Blocks: even; within: free; no observed") +}) From noreply at r-forge.r-project.org Sun Jan 26 20:21:11 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 26 Jan 2014 20:21:11 +0100 (CET) Subject: [Vegan-commits] r2843 - in pkg/permute: . R inst Message-ID: <20140126192111.EFEB71856FC@r-forge.r-project.org> Author: gsimpson Date: 2014-01-26 20:21:11 +0100 (Sun, 26 Jan 2014) New Revision: 2843 Modified: pkg/permute/DESCRIPTION pkg/permute/R/allPerms.R pkg/permute/inst/ChangeLog Log: fix bug in plot-level permutations; now uses cbindAllPerms() for consistency. Bump to 0.8-3. Modified: pkg/permute/DESCRIPTION =================================================================== --- pkg/permute/DESCRIPTION 2014-01-26 19:20:03 UTC (rev 2842) +++ pkg/permute/DESCRIPTION 2014-01-26 19:21:11 UTC (rev 2843) @@ -1,6 +1,6 @@ Package: permute Title: Functions for generating restricted permutations of data -Version: 0.8-2 +Version: 0.8-3 Date: $Date$ Authors at R: c(person(given = "Gavin L.", family = "Simpson", email = "ucfagls at gmail.com", Modified: pkg/permute/R/allPerms.R =================================================================== --- pkg/permute/R/allPerms.R 2014-01-26 19:20:03 UTC (rev 2842) +++ pkg/permute/R/allPerms.R 2014-01-26 19:21:11 UTC (rev 2843) @@ -157,19 +157,21 @@ ord <- switch(typeW, free = allFree(tab[j]), series = allSeries(tab[j], np, mirrorW)) - permW <- nrow(ord) - if(j == 1) { - a <- 1 - b <- nperms / np - } else { - b <- b / np - a <- nperms / (b * np) - } - res[[j]] <- matrix(rep(repMat(ord+add[j], a), - each = b), - ncol = tab[j]) + res[[j]] <- ord + ## permW <- nrow(ord) + ## if(j == 1) { + ## a <- 1 + ## b <- nperms / np + ## } else { + ## b <- b / np + ## a <- nperms / (b * np) + ## } + ## res[[j]] <- matrix(rep(repMat(ord+add[j], a), + ## each = b), + ## ncol = tab[j]) } - res <- do.call(cbind, res) + ##res <- do.call(cbind, res) + res <- cbindAllPerms(res) sp <- split(obs, strataP) res <- t(apply(res, 1, function(x, inds, o) {o[inds] <- inds[x]; o}, @@ -184,21 +186,14 @@ series = allSeries(pg, np, mirrorW), grid = allGrid(pg, np, dimW[1], dimW[2], mirrorW, constantW)) - permW <- nrow(ord) - add <- seq(from = 0, by = pg, length.out = ng) res <- vector(mode = "list", length = ng) - a <- 1 - b <- np / permW + ss <- seq(0, to = prod(pg, ng-1), by = pg) for(i in seq_len(ng)) { - res[[i]] <- matrix(rep(repMat(ord+add[i], a), - each = b), - ncol = pg) - a <- a*permW - b <- b/permW + res[[i]] <- ord + ss[i] } - res <- do.call(cbind, res) + res <- cbindAllPerms(res) sp <- split(obs, strataP) - res <- t(apply(res, 1, + res2 <- t(apply(res, 1, function(x, inds, o) {o[inds] <- inds[x]; o}, unlist(sp), obs)) } Modified: pkg/permute/inst/ChangeLog =================================================================== --- pkg/permute/inst/ChangeLog 2014-01-26 19:20:03 UTC (rev 2842) +++ pkg/permute/inst/ChangeLog 2014-01-26 19:21:11 UTC (rev 2843) @@ -2,6 +2,14 @@ permute ChangeLog +Version 0.8-3 + + * allPerms: with free permutations *within* plots, `allPerms()` + was not returning the indices in the original data but in the + permutation indices within plots. + + Reported by: Joris Meys + Version 0.8-2 * allPerms: with free permutations *within* blocks, `allPerms()` From noreply at r-forge.r-project.org Sun Jan 26 20:39:48 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 26 Jan 2014 20:39:48 +0100 (CET) Subject: [Vegan-commits] r2844 - pkg/permute/R Message-ID: <20140126193948.F01EE18115D@r-forge.r-project.org> Author: gsimpson Date: 2014-01-26 20:39:48 +0100 (Sun, 26 Jan 2014) New Revision: 2844 Modified: pkg/permute/R/allPerms.R Log: reverse a small part of earlier fix which removed a reindex of the observations at the allPerms level Modified: pkg/permute/R/allPerms.R =================================================================== --- pkg/permute/R/allPerms.R 2014-01-26 19:21:11 UTC (rev 2843) +++ pkg/permute/R/allPerms.R 2014-01-26 19:39:48 UTC (rev 2844) @@ -65,7 +65,7 @@ ## bind all the blocks together ## out <- do.call(cbind, out) ## hmm are any of these the same shape? - ##out[, unlist(spl)] <- out ## is this being done at the doAllPerms level? + out[, unlist(spl)] <- out ## is this being done at the doAllPerms level? if(!(observed <- getObserved(control))) { obs.v <- seq_len(n) From noreply at r-forge.r-project.org Sun Jan 26 23:16:03 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 26 Jan 2014 23:16:03 +0100 (CET) Subject: [Vegan-commits] r2845 - pkg/permute/inst/tests Message-ID: <20140126221603.F0741185AE0@r-forge.r-project.org> Author: gsimpson Date: 2014-01-26 23:16:03 +0100 (Sun, 26 Jan 2014) New Revision: 2845 Modified: pkg/permute/inst/tests/test-allPerms.R Log: add uneven plots unit test in allPerms Modified: pkg/permute/inst/tests/test-allPerms.R =================================================================== --- pkg/permute/inst/tests/test-allPerms.R 2014-01-26 19:39:48 UTC (rev 2844) +++ pkg/permute/inst/tests/test-allPerms.R 2014-01-26 22:16:03 UTC (rev 2845) @@ -36,7 +36,7 @@ expect_false(dup, info = "Blocks: even; within: free; observed") }) -test_that("allPerms - blocks - within block free - uneven block sizes", { +test_that("allPerms; blocks: within; block free - uneven block sizes", { fac <- factor(rep(1:3, times = c(2,2,4))) ## without the observed permutation included @@ -81,5 +81,47 @@ ## check no duplicate indices within rows dup <- any(apply(p, 1, function(x) any(duplicated(x)))) expect_false(dup, - info = "Checking Unique: Blocks: even; within: free; no observed") + info = "Unique? Plots: even; within: free; no observed") + + ## with the observed permutation included + hh <- how(within = Within("free"), + plot = Plots(strata = fac), + complete = TRUE, maxperm = 1e9, + observed = TRUE) + p <- allPerms(ll, control = hh) + expect_that(nrow(p), equals(np)) ## now includes observed + + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, info = "Unique? Plots: even; within: free; inc observed") }) + +test_that("allPerms; plots: within; plot free - uneven plot sizes", { + fac <- factor(rep(1:3, times = c(2,2,4))) + + ## without the observed permutation included + hh <- how(within = Within("free"), + plots = Plots(strata = fac), + complete = TRUE, maxperm = 1e9) + ll <- length(fac) + np <- numPerms(ll, hh) + expect_that(np, equals(prod(factorial(2), factorial(2), factorial(4)))) + p <- allPerms(ll, control = hh) + expect_that(nrow(p), equals(np - 1)) ## default is to drop observed + + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, info = "Plots: uneven; within: free; no observed") + + ## with the observed permutation included + hh <- how(within = Within("free"), + plots = Plots(strata = fac), + complete = TRUE, maxperm = 1e9, + observed = TRUE) + p <- allPerms(ll, control = hh) + expect_that(nrow(p), equals(np)) ## now includes observed + + ## check no duplicate indices within rows + dup <- any(apply(p, 1, function(x) any(duplicated(x)))) + expect_false(dup, info = "Plots: uneven; within: free; observed") +}) From noreply at r-forge.r-project.org Sun Jan 26 23:17:17 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 26 Jan 2014 23:17:17 +0100 (CET) Subject: [Vegan-commits] r2846 - pkg/permute/R Message-ID: <20140126221717.9A16C185B77@r-forge.r-project.org> Author: gsimpson Date: 2014-01-26 23:17:17 +0100 (Sun, 26 Jan 2014) New Revision: 2846 Modified: pkg/permute/R/allPerms.R Log: simplify code, remove redundant lines. Modified: pkg/permute/R/allPerms.R =================================================================== --- pkg/permute/R/allPerms.R 2014-01-26 22:16:03 UTC (rev 2845) +++ pkg/permute/R/allPerms.R 2014-01-26 22:17:17 UTC (rev 2846) @@ -84,12 +84,6 @@ `doAllPerms` <- function(obs, strataP, typeW, typeP, mirrorW, mirrorP, constantW, dimW, dimP, control, nperms) { - ## replicate a matrix by going via a list and bind together - repMat <- function(mat, n) { - res <- rep(list(mat), n) - do.call(rbind, res) - } - n <- length(obs) ## subset strataP to take only the obs indices and drop the unused @@ -101,6 +95,9 @@ ## also need to update the $strata component of control ## FIXME: this really should have a toplevel function to set/update ## sub-components of control + ## Pl <- getPlots(control) + ## setStrata(Pl) <- strataP + ## setPlots(control) <- Pl control$plots$strata <- strataP ## permuting within? @@ -112,16 +109,15 @@ series = allSeries(n, nperms, mirrorW), grid = allGrid(n, nperms, dimW[1], dimW[2], mirrorW, constantW)) - ## use res to index the original observation indices in - ## this group + ## use res to index original observation indices in this group res[] <- obs[res] } else { ## permuting within plots tab <- table(strataP) pg <- unique(tab) + ng <- length(tab) if(constantW) { ## same permutation in each plot - ##pg <- unique(tab) controlW <- how(within = getWithin(control)) nperms <- numPerms(pg, controlW) ord <- switch(typeW, @@ -129,19 +125,19 @@ series = allSeries(pg, nperms, mirrorW), grid = allGrid(pg, nperms, dimW[1], dimW[2], mirrorW, constantW)) - permW <- nrow(ord) - sp <- split(obs, strataP) - res <- matrix(nrow = nperms, ncol = n) - for(i in seq_len(permW)) { - res[i,] <- sapply(sp, - function(x, ord) x[ord[i,]], ord = ord) + res <- vector(mode = "list", length = ng) + ss <- seq(0, to = prod(pg, ng-1), by = pg) + for (i in seq_len(ng)) { + res[[i]] <- ord + ss[i] } + ## same permutation within plots, so just cbind rather than + ## cbindAllPerms as we don't need all combns of rows + res <- do.call(cbind, res) + res[] <- obs[res] ## index into the observations in this block } else { ## different permutations within plots nperms <- numPerms(sum(tab), control) - ng <- length(tab) - ##pg <- unique(tab) if(length(pg) > 1) { ## different number of observations per level of strata if(typeW == "grid") @@ -149,7 +145,6 @@ ## in place in check() stop("Unbalanced grid designs are not supported") controlW <- how(within = getWithin(control)) - sp <- split(obs, strataP) res <- vector(mode = "list", length = ng) add <- c(0, cumsum(tab)[1:(ng-1)]) for(j in seq_along(tab)) { @@ -157,25 +152,10 @@ ord <- switch(typeW, free = allFree(tab[j]), series = allSeries(tab[j], np, mirrorW)) - res[[j]] <- ord - ## permW <- nrow(ord) - ## if(j == 1) { - ## a <- 1 - ## b <- nperms / np - ## } else { - ## b <- b / np - ## a <- nperms / (b * np) - ## } - ## res[[j]] <- matrix(rep(repMat(ord+add[j], a), - ## each = b), - ## ncol = tab[j]) + res[[j]] <- ord + add[j] } - ##res <- do.call(cbind, res) res <- cbindAllPerms(res) - sp <- split(obs, strataP) - res <- t(apply(res, 1, - function(x, inds, o) {o[inds] <- inds[x]; o}, - unlist(sp), obs)) + res[] <- obs[res] } else { ## same number of observations per level of strata controlW <- how(within = getWithin(control)) @@ -192,10 +172,7 @@ res[[i]] <- ord + ss[i] } res <- cbindAllPerms(res) - sp <- split(obs, strataP) - res2 <- t(apply(res, 1, - function(x, inds, o) {o[inds] <- inds[x]; o}, - unlist(sp), obs)) + res[] <- obs[res] } } } From noreply at r-forge.r-project.org Tue Jan 28 05:02:29 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 28 Jan 2014 05:02:29 +0100 (CET) Subject: [Vegan-commits] r2847 - pkg/permute/tests/Examples Message-ID: <20140128040230.0A45B186CFC@r-forge.r-project.org> Author: gsimpson Date: 2014-01-28 05:02:29 +0100 (Tue, 28 Jan 2014) New Revision: 2847 Modified: pkg/permute/tests/Examples/permute-Ex.Rout.save Log: update reference material for checking Examples Modified: pkg/permute/tests/Examples/permute-Ex.Rout.save =================================================================== --- pkg/permute/tests/Examples/permute-Ex.Rout.save 2014-01-26 22:17:17 UTC (rev 2846) +++ pkg/permute/tests/Examples/permute-Ex.Rout.save 2014-01-28 04:02:29 UTC (rev 2847) @@ -1,6 +1,6 @@ -R version 3.0.2 Patched (2013-09-26 r64005) -- "Frisbee Sailing" -Copyright (C) 2013 The R Foundation for Statistical Computing +R version 3.0.2 Patched (2014-01-14 r64768) -- "Frisbee Sailing" +Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. @@ -207,7 +207,7 @@ > require(vegan) Loading required package: vegan Loading required package: lattice -This is vegan 2.1-37 +This is vegan 2.0-10 > example(pyrifos) pyrifs> data(pyrifos) @@ -1207,7 +1207,7 @@ > ### > options(digits = 7L) > base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n") -Time elapsed: 2.288 0.038 2.347 0 0 +Time elapsed: 2.257 0.042 2.373 0 0 > grDevices::dev.off() null device 1