[Picante-commits] r39 - / pkg/R pkg/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Mar 3 08:39:31 CET 2008
Author: skembel
Date: 2008-03-03 08:39:31 +0100 (Mon, 03 Mar 2008)
New Revision: 39
Added:
pkg/R/ses.mnnd.R
pkg/R/ses.mpd.R
pkg/man/ses.mnnd.R
pkg/man/ses.mpd.R
Removed:
pkg/R/nri.R
pkg/R/nti.R
pkg/man/nri.Rd
pkg/man/nti.Rd
Modified:
TODO
pkg/man/mnnd.Rd
pkg/man/mpd.Rd
pkg/man/species.dist.Rd
Log:
Documentation cleanup to pass R CMD check
Modified: TODO
===================================================================
--- TODO 2008-03-03 07:28:55 UTC (rev 38)
+++ TODO 2008-03-03 07:39:31 UTC (rev 39)
@@ -6,11 +6,10 @@
====
For 0.1
-------
--fix trait data input - currently most functions expect a vector with names, should handle/check lack of names and allow data.frames (single or multiple columns).
--fix null models - most assume presence-absence data but don't check
--standardize use of null model functions (combine all into one function)
--standardize species distance metrics (combine all into one function)
--clean up/hide utility functions
+-fix trait data input - currently most functions expect a vector with names, should handle/check lack of names and warn
+-allow trait data to be a vector or a data.frame (single or multiple columns) (maybe for 0.2?)
+-clean up/hide utility functions, merge into one file
+-merge community structure and phylocom functions into one file?
For 0.2
-------
@@ -18,3 +17,5 @@
-implement contrib index and similar
-qr on comdist as option
-trait gradient analysis and contrast diagnostics functions from DDA
+-taxaShuffle and comstruct functions - rewrite to use indices in place of names for efficiency
+
Deleted: pkg/R/nri.R
===================================================================
--- pkg/R/nri.R 2008-03-03 07:28:55 UTC (rev 38)
+++ pkg/R/nri.R 2008-03-03 07:39:31 UTC (rev 39)
@@ -1,23 +0,0 @@
-`ses.mpd` <-
-function (samp, dis, null.model = c("taxa.labels", "sample.pool",
- "phylogeny.pool", "weighted.sample.pool"), runs = 99)
-{
- dis <- as.matrix(dis)
- mpd.obs <- mpd(samp, dis)
- null.model <- match.arg(null.model)
- mpd.rand <- switch(null.model,
- taxa.labels = t(replicate(runs, mpd(samp, taxaShuffle(dis)))),
- sample.pool = t(replicate(runs, mpd(randomizeSample(samp,null.model="richness"), dis))),
- phylogeny.pool = t(replicate(runs, mpd(randomizeSample(samp,null.model="richness"),
- taxaShuffle(dis)))),
- weighted.sample.pool = t(replicate(runs, mpd(randomizeSample(samp,
- null.model = "both"), dis))))
- mpd.obs.rank <- apply(X = rbind(mpd.obs, mpd.rand), MARGIN = 2,
- FUN = rank)[1, ]
- mpd.rand.mean <- apply(X = mpd.rand, MARGIN = 2, FUN = mean, na.rm=TRUE)
- mpd.rand.sd <- apply(X = mpd.rand, MARGIN = 2, FUN = sd, na.rm=TRUE)
- mpd.obs.z <- (mpd.obs - mpd.rand.mean)/mpd.rand.sd
- data.frame(ntaxa=specnumber(samp),mpd.obs, mpd.rand.mean, mpd.rand.sd, mpd.obs.rank,
- mpd.obs.z, mpd.obs.p=mpd.obs.rank/(runs+1),runs=runs, row.names = row.names(samp))
-}
-
Deleted: pkg/R/nti.R
===================================================================
--- pkg/R/nti.R 2008-03-03 07:28:55 UTC (rev 38)
+++ pkg/R/nti.R 2008-03-03 07:39:31 UTC (rev 39)
@@ -1,23 +0,0 @@
-`ses.mnnd` <-
-function (samp, dis, null.model = c("taxa.labels", "sample.pool",
- "phylogeny.pool", "weighted.sample.pool"), runs = 99)
-{
- dis <- as.matrix(dis)
- mnnd.obs <- mnnd(samp, dis)
- null.model <- match.arg(null.model)
- mnnd.rand <- switch(null.model,
- taxa.labels = t(replicate(runs, mnnd(samp, taxaShuffle(dis)))),
- sample.pool = t(replicate(runs, mnnd(randomizeSample(samp,null.model="richness"), dis))),
- phylogeny.pool = t(replicate(runs, mnnd(randomizeSample(samp,null.model="richness"),
- taxaShuffle(dis)))),
- weighted.sample.pool = t(replicate(runs, mnnd(randomizeSample(samp,
- null.model = "both"), dis))))
- mnnd.obs.rank <- apply(X = rbind(mnnd.obs, mnnd.rand), MARGIN = 2,
- FUN = rank)[1, ]
- mnnd.rand.mean <- apply(X = mnnd.rand, MARGIN = 2, FUN = mean, na.rm=TRUE)
- mnnd.rand.sd <- apply(X = mnnd.rand, MARGIN = 2, FUN = sd, na.rm=TRUE)
- mnnd.obs.z <- (mnnd.obs - mnnd.rand.mean)/mnnd.rand.sd
- data.frame(ntaxa=specnumber(samp),mnnd.obs, mnnd.rand.mean, mnnd.rand.sd, mnnd.obs.rank,
- mnnd.obs.z, mnnd.obs.p=mnnd.obs.rank/(runs+1),runs=runs, row.names = row.names(samp))
-}
-
Copied: pkg/R/ses.mnnd.R (from rev 38, pkg/R/nti.R)
===================================================================
--- pkg/R/ses.mnnd.R (rev 0)
+++ pkg/R/ses.mnnd.R 2008-03-03 07:39:31 UTC (rev 39)
@@ -0,0 +1,23 @@
+`ses.mnnd` <-
+function (samp, dis, null.model = c("taxa.labels", "sample.pool",
+ "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+{
+ dis <- as.matrix(dis)
+ mnnd.obs <- mnnd(samp, dis)
+ null.model <- match.arg(null.model)
+ mnnd.rand <- switch(null.model,
+ taxa.labels = t(replicate(runs, mnnd(samp, taxaShuffle(dis)))),
+ sample.pool = t(replicate(runs, mnnd(randomizeSample(samp,null.model="richness"), dis))),
+ phylogeny.pool = t(replicate(runs, mnnd(randomizeSample(samp,null.model="richness"),
+ taxaShuffle(dis)))),
+ weighted.sample.pool = t(replicate(runs, mnnd(randomizeSample(samp,
+ null.model = "both"), dis))))
+ mnnd.obs.rank <- apply(X = rbind(mnnd.obs, mnnd.rand), MARGIN = 2,
+ FUN = rank)[1, ]
+ mnnd.rand.mean <- apply(X = mnnd.rand, MARGIN = 2, FUN = mean, na.rm=TRUE)
+ mnnd.rand.sd <- apply(X = mnnd.rand, MARGIN = 2, FUN = sd, na.rm=TRUE)
+ mnnd.obs.z <- (mnnd.obs - mnnd.rand.mean)/mnnd.rand.sd
+ data.frame(ntaxa=specnumber(samp),mnnd.obs, mnnd.rand.mean, mnnd.rand.sd, mnnd.obs.rank,
+ mnnd.obs.z, mnnd.obs.p=mnnd.obs.rank/(runs+1),runs=runs, row.names = row.names(samp))
+}
+
Copied: pkg/R/ses.mpd.R (from rev 38, pkg/R/nri.R)
===================================================================
--- pkg/R/ses.mpd.R (rev 0)
+++ pkg/R/ses.mpd.R 2008-03-03 07:39:31 UTC (rev 39)
@@ -0,0 +1,23 @@
+`ses.mpd` <-
+function (samp, dis, null.model = c("taxa.labels", "sample.pool",
+ "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+{
+ dis <- as.matrix(dis)
+ mpd.obs <- mpd(samp, dis)
+ null.model <- match.arg(null.model)
+ mpd.rand <- switch(null.model,
+ taxa.labels = t(replicate(runs, mpd(samp, taxaShuffle(dis)))),
+ sample.pool = t(replicate(runs, mpd(randomizeSample(samp,null.model="richness"), dis))),
+ phylogeny.pool = t(replicate(runs, mpd(randomizeSample(samp,null.model="richness"),
+ taxaShuffle(dis)))),
+ weighted.sample.pool = t(replicate(runs, mpd(randomizeSample(samp,
+ null.model = "both"), dis))))
+ mpd.obs.rank <- apply(X = rbind(mpd.obs, mpd.rand), MARGIN = 2,
+ FUN = rank)[1, ]
+ mpd.rand.mean <- apply(X = mpd.rand, MARGIN = 2, FUN = mean, na.rm=TRUE)
+ mpd.rand.sd <- apply(X = mpd.rand, MARGIN = 2, FUN = sd, na.rm=TRUE)
+ mpd.obs.z <- (mpd.obs - mpd.rand.mean)/mpd.rand.sd
+ data.frame(ntaxa=specnumber(samp),mpd.obs, mpd.rand.mean, mpd.rand.sd, mpd.obs.rank,
+ mpd.obs.z, mpd.obs.p=mpd.obs.rank/(runs+1),runs=runs, row.names = row.names(samp))
+}
+
Modified: pkg/man/mnnd.Rd
===================================================================
--- pkg/man/mnnd.Rd 2008-03-03 07:28:55 UTC (rev 38)
+++ pkg/man/mnnd.Rd 2008-03-03 07:39:31 UTC (rev 39)
@@ -18,5 +18,5 @@
}
\references{ Webb et al. 2002. ARES. }
\author{ Steve Kembel <skembel at berkeley.edu> }
-\seealso{ \code{\link{nti}} }
+\seealso{ \code{\link{ses.mnnd}} }
\keyword{univar}
Modified: pkg/man/mpd.Rd
===================================================================
--- pkg/man/mpd.Rd 2008-03-03 07:28:55 UTC (rev 38)
+++ pkg/man/mpd.Rd 2008-03-03 07:39:31 UTC (rev 39)
@@ -18,5 +18,5 @@
}
\references{ Webb et al. 2002. ARES. }
\author{ Steve Kembel <skembel at berkeley.edu> }
-\seealso{ \code{\link{nri}}}
+\seealso{ \code{\link{ses.mpd}}}
\keyword{univar}
Deleted: pkg/man/nri.Rd
===================================================================
--- pkg/man/nri.Rd 2008-03-03 07:28:55 UTC (rev 38)
+++ pkg/man/nri.Rd 2008-03-03 07:39:31 UTC (rev 39)
@@ -1,27 +0,0 @@
-\name{ses.mpd}
-\alias{nri}
-\alias{ses.mpd}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ Net Relatedness Index }
-\description{
- Net Relatedness Index of community phylogenetic structure
-}
-\usage{
-nri(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
-}
-%- maybe also 'usage' for other objects documented here.
-\arguments{
- \item{samp}{ Community data matrix }
- \item{phylo.dist}{ Cophenetic phylogenetic distance matrix }
- \item{null.model}{ Choice of null models }
- \item{runs}{ Number of randomizations }
-}
-
-\value{
- Data frame of results
-}
-\references{ Webb et al. 2002, 2007 }
-\author{ Steve Kembel <skembel at berkeley.edu> }
-\section{Warning }{Weighted sample pool null ONLY works with presence-absence data}
-\seealso{ \code{\link{mpd}} }
-\keyword{univar}
Deleted: pkg/man/nti.Rd
===================================================================
--- pkg/man/nti.Rd 2008-03-03 07:28:55 UTC (rev 38)
+++ pkg/man/nti.Rd 2008-03-03 07:39:31 UTC (rev 39)
@@ -1,27 +0,0 @@
-\name{ses.mnnd}
-\alias{nti}
-\alias{ses.mnnd}
-
-\title{ Nearest Taxon Index }
-\description{
- Nearest Taxon Index of community phylogenetic structure
-}
-\usage{
-nti(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
-}
-
-\arguments{
- \item{samp}{ Community data matrix }
- \item{phylo.dist}{ Cophenetic phylogenetic distance matrix }
- \item{null.model}{ Choice of null models }
- \item{runs}{ Number of randomizations }
-}
-
-\value{
- Data frame of results
-}
-\references{ Webb et al. 2002, 2007 }
-\author{ Steve Kembel <skembel at berkeley.edu> }
-\section{Warning }{Weighted sample pool null ONLY works with presence-absence data}
-\seealso{ \code{\link{mnnd}} }
-\keyword{univar}
Copied: pkg/man/ses.mnnd.R (from rev 38, pkg/man/nti.Rd)
===================================================================
--- pkg/man/ses.mnnd.R (rev 0)
+++ pkg/man/ses.mnnd.R 2008-03-03 07:39:31 UTC (rev 39)
@@ -0,0 +1,27 @@
+\name{ses.mnnd}
+\alias{nti}
+\alias{ses.mnnd}
+
+\title{ Nearest Taxon Index }
+\description{
+ Nearest Taxon Index of community phylogenetic structure
+}
+\usage{
+nti(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+}
+
+\arguments{
+ \item{samp}{ Community data matrix }
+ \item{phylo.dist}{ Cophenetic phylogenetic distance matrix }
+ \item{null.model}{ Choice of null models }
+ \item{runs}{ Number of randomizations }
+}
+
+\value{
+ Data frame of results
+}
+\references{ Webb et al. 2002, 2007 }
+\author{ Steve Kembel <skembel at berkeley.edu> }
+\section{Warning }{Weighted sample pool null ONLY works with presence-absence data}
+\seealso{ \code{\link{mnnd}} }
+\keyword{univar}
Copied: pkg/man/ses.mpd.R (from rev 38, pkg/man/nri.Rd)
===================================================================
--- pkg/man/ses.mpd.R (rev 0)
+++ pkg/man/ses.mpd.R 2008-03-03 07:39:31 UTC (rev 39)
@@ -0,0 +1,27 @@
+\name{ses.mpd}
+\alias{nri}
+\alias{ses.mpd}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{ Net Relatedness Index }
+\description{
+ Net Relatedness Index of community phylogenetic structure
+}
+\usage{
+nri(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{samp}{ Community data matrix }
+ \item{phylo.dist}{ Cophenetic phylogenetic distance matrix }
+ \item{null.model}{ Choice of null models }
+ \item{runs}{ Number of randomizations }
+}
+
+\value{
+ Data frame of results
+}
+\references{ Webb et al. 2002, 2007 }
+\author{ Steve Kembel <skembel at berkeley.edu> }
+\section{Warning }{Weighted sample pool null ONLY works with presence-absence data}
+\seealso{ \code{\link{mpd}} }
+\keyword{univar}
Modified: pkg/man/species.dist.Rd
===================================================================
--- pkg/man/species.dist.Rd 2008-03-03 07:28:55 UTC (rev 38)
+++ pkg/man/species.dist.Rd 2008-03-03 07:39:31 UTC (rev 39)
@@ -20,5 +20,5 @@
\author{ Steve Kembel <skembel at berkeley.edu> }
-\seealso{ \code{\link{cij}}, \code{\link{roij}},\code{\link[vegan]{vegdist}} }
+\seealso{ \code{\link[vegan]{vegdist}} }
\keyword{univar}
More information about the Picante-commits
mailing list