[Picante-commits] r223 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 9 01:44:07 CEST 2010


Author: skembel
Date: 2010-04-09 01:44:07 +0200 (Fri, 09 Apr 2010)
New Revision: 223

Modified:
   pkg/R/phylodiversity.R
   pkg/man/ses.mntd.Rd
   pkg/man/ses.mpd.Rd
   pkg/man/ses.pd.Rd
Log:
Reinstating the richness and frequency null models

Modified: pkg/R/phylodiversity.R
===================================================================
--- pkg/R/phylodiversity.R	2010-04-08 23:19:43 UTC (rev 222)
+++ pkg/R/phylodiversity.R	2010-04-08 23:44:07 UTC (rev 223)
@@ -165,7 +165,7 @@
 
 
 `ses.mpd` <-
-function (samp, dis, null.model = c("taxa.labels", "sample.pool", 
+function (samp, dis, null.model = c("taxa.labels", "richness", "frequency", "sample.pool", 
     "phylogeny.pool", "independentswap", "trialswap"),
     abundance.weighted = FALSE, runs = 999, iterations = 1000) 
 {
@@ -174,6 +174,8 @@
     null.model <- match.arg(null.model)
     mpd.rand <- switch(null.model,
     	taxa.labels = t(replicate(runs, mpd(samp, taxaShuffle(dis), abundance.weighted=abundance.weighted))),
+    	richness = t(replicate(runs, mpd(randomizeMatrix(samp,null.model="richness"), dis, abundance.weighted))),
+    	frequency = t(replicate(runs, mpd(randomizeMatrix(samp,null.model="frequency"), dis, abundance.weighted))),    	
     	sample.pool = t(replicate(runs, mpd(randomizeMatrix(samp,null.model="richness"), dis, abundance.weighted))),
     	phylogeny.pool = t(replicate(runs, mpd(randomizeMatrix(samp,null.model="richness"),
     		taxaShuffle(dis), abundance.weighted))),
@@ -192,7 +194,7 @@
 
 
 `ses.mntd` <-
-function (samp, dis, null.model = c("taxa.labels", "sample.pool", 
+function (samp, dis, null.model = c("taxa.labels", "richness", "frequency", "sample.pool", 
     "phylogeny.pool", "independentswap", "trialswap"),
     abundance.weighted = FALSE, runs = 999, iterations = 1000) 
 {
@@ -201,6 +203,8 @@
     null.model <- match.arg(null.model)
     mntd.rand <- switch(null.model,
     	taxa.labels = t(replicate(runs, mntd(samp, taxaShuffle(dis), abundance.weighted))),
+    	richness = t(replicate(runs, mntd(randomizeMatrix(samp,null.model="richness"), dis, abundance.weighted))),
+    	frequency = t(replicate(runs, mntd(randomizeMatrix(samp,null.model="frequency"), dis, abundance.weighted))),
     	sample.pool = t(replicate(runs, mntd(randomizeMatrix(samp,null.model="richness"), dis, abundance.weighted))),
     	phylogeny.pool = t(replicate(runs, mntd(randomizeMatrix(samp,null.model="richness"),
     		taxaShuffle(dis), abundance.weighted))),
@@ -591,13 +595,15 @@
 }
 
 `ses.pd` <-
-function (samp, tree, null.model = c("taxa.labels", "sample.pool", 
+function (samp, tree, null.model = c("taxa.labels", "richness", "frequency", "sample.pool", 
     "phylogeny.pool", "independentswap", "trialswap"), runs = 999, iterations = 1000, ...) 
 {
     pd.obs <- as.vector(pd(samp, tree, ...)$PD)
     null.model <- match.arg(null.model)
     pd.rand <- switch(null.model,
     	taxa.labels = t(replicate(runs, as.vector(pd(samp, tipShuffle(tree), ...)$PD))),
+    	richness = t(replicate(runs, as.vector(pd(randomizeMatrix(samp,null.model="richness"), tree, ...)$PD))),
+    	frequency = t(replicate(runs, as.vector(pd(randomizeMatrix(samp,null.model="frequency"), tree, ...)$PD))),    	
     	sample.pool = t(replicate(runs, as.vector(pd(randomizeMatrix(samp,null.model="richness"), tree, ...)$PD))),
     	phylogeny.pool = t(replicate(runs, as.vector(pd(randomizeMatrix(samp,null.model="richness"),
     		tipShuffle(tree), ...)$PD))),

Modified: pkg/man/ses.mntd.Rd
===================================================================
--- pkg/man/ses.mntd.Rd	2010-04-08 23:19:43 UTC (rev 222)
+++ pkg/man/ses.mntd.Rd	2010-04-08 23:44:07 UTC (rev 223)
@@ -7,7 +7,7 @@
   Standardized effect size of mean nearest taxon distances in communities. When used with a phylogenetic distance matrix, equivalent to -1 times the Nearest Taxon Index (NTI).
 }
 \usage{
-ses.mntd(samp, dis, null.model = c("taxa.labels","sample.pool", "phylogeny.pool", "independentswap", "trialswap"),
+ses.mntd(samp, dis, null.model = c("taxa.labels", "richness", "frequency", "sample.pool", "phylogeny.pool", "independentswap", "trialswap"),
     abundance.weighted=FALSE, runs = 999, iterations = 1000)
 }
 
@@ -37,10 +37,10 @@
 Currently implemented null models (arguments to null.model):
 \describe{
     \item{taxa.labels}{ Shuffle distance matrix labels (across all taxa included in distance matrix)}
+    \item{richness}{ Randomize community data matrix abundances within samples (maintains sample species richness)}    
+    \item{frequency}{ Randomize community data matrix abundances within species (maintains species occurence frequency)}
     \item{sample.pool}{ Randomize community data matrix by drawing species from pool of species occurring in at least one community (sample pool) with equal probability}  
     \item{phylogeny.pool}{ Randomize community data matrix by drawing species from pool of species occurring in the distance matrix (phylogeny pool) with equal probability}  
-    \item{frequency}{ Randomize community data matrix abundances within species (maintains species occurence frequency)}
-    \item{richness}{ Randomize community data matrix abundances within samples (maintains sample species richness)}
     \item{independentswap}{ Randomize community data matrix with the independent swap algorithm (Gotelli 2000) maintaining species occurrence frequency and sample species richness }
     \item{trialswap}{ Randomize community data matrix with the trial-swap algorithm (Miklos & Podani 2004) maintaining species occurrence frequency and sample species richness }
 }

Modified: pkg/man/ses.mpd.Rd
===================================================================
--- pkg/man/ses.mpd.Rd	2010-04-08 23:19:43 UTC (rev 222)
+++ pkg/man/ses.mpd.Rd	2010-04-08 23:44:07 UTC (rev 223)
@@ -6,7 +6,7 @@
   Standardized effect size of mean pairwise distances in communities. When used with a phylogenetic distance matrix, equivalent to -1 times the Nearest Relative Index (NRI).
 }
 \usage{
-ses.mpd(samp, dis, null.model = c("taxa.labels", "sample.pool",
+ses.mpd(samp, dis, null.model = c("taxa.labels", "richness", "frequency", "sample.pool",
             "phylogeny.pool", "independentswap", "trialswap"),
             abundance.weighted = FALSE, runs = 999, iterations = 1000)
 }
@@ -35,10 +35,10 @@
 Currently implemented null models (arguments to null.model):
 \describe{
     \item{taxa.labels}{ Shuffle distance matrix labels (across all taxa included in distance matrix)}
+    \item{richness}{ Randomize community data matrix abundances within samples (maintains sample species richness)}
+    \item{frequency}{ Randomize community data matrix abundances within species (maintains species occurence frequency)}
     \item{sample.pool}{ Randomize community data matrix by drawing species from pool of species occurring in at least one community (sample pool) with equal probability}  
     \item{phylogeny.pool}{ Randomize community data matrix by drawing species from pool of species occurring in the distance matrix (phylogeny pool) with equal probability}  
-    \item{frequency}{ Randomize community data matrix abundances within species (maintains species occurence frequency)}
-    \item{richness}{ Randomize community data matrix abundances within samples (maintains sample species richness)}
     \item{independentswap}{ Randomize community data matrix with the independent swap algorithm (Gotelli 2000) maintaining species occurrence frequency and sample species richness }
     \item{trialswap}{ Randomize community data matrix with the trial-swap algorithm (Miklos & Podani 2004) maintaining species occurrence frequency and sample species richness }
     }

Modified: pkg/man/ses.pd.Rd
===================================================================
--- pkg/man/ses.pd.Rd	2010-04-08 23:19:43 UTC (rev 222)
+++ pkg/man/ses.pd.Rd	2010-04-08 23:44:07 UTC (rev 223)
@@ -6,9 +6,9 @@
   Standardized effect size of phylogenetic diversity (Faith's PD) in communities.
 }
 \usage{
-ses.pd(samp, tree, null.model = c("taxa.labels", "sample.pool",
-            "phylogeny.pool", "independentswap", "trialswap"),
-            runs = 999, iterations = 1000, ...)
+ses.pd(samp, tree, null.model = c("taxa.labels", "richness", "frequency",
+    "sample.pool", "phylogeny.pool", "independentswap", "trialswap"),
+    runs = 999, iterations = 1000, ...)
 }
 
 \arguments{
@@ -35,10 +35,10 @@
 Currently implemented null models (arguments to null.model):
 \describe{
     \item{taxa.labels}{ Shuffle taxa labels across tips of phylogeny (across all taxa included in phylogeny)}
+    \item{richness}{ Randomize community data matrix abundances within samples (maintains sample species richness)}    
+    \item{frequency}{ Randomize community data matrix abundances within species (maintains species occurence frequency)}    
     \item{sample.pool}{ Randomize community data matrix by drawing species from pool of species occurring in at least one community (sample pool) with equal probability}  
     \item{phylogeny.pool}{ Randomize community data matrix by drawing species from pool of species occurring in the phylogeny (phylogeny pool) with equal probability}  
-    \item{frequency}{ Randomize community data matrix abundances within species (maintains species occurence frequency)}
-    \item{richness}{ Randomize community data matrix abundances within samples (maintains sample species richness)}
     \item{independentswap}{ Randomize community data matrix with the independent swap algorithm (Gotelli 2000) maintaining species occurrence frequency and sample species richness }
     \item{trialswap}{ Randomize community data matrix with the trial-swap algorithm (Miklos & Podani 2004) maintaining species occurrence frequency and sample species richness }
     }



More information about the Picante-commits mailing list