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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 26 01:41:34 CEST 2008


Author: skembel
Date: 2008-04-26 01:41:34 +0200 (Sat, 26 Apr 2008)
New Revision: 58

Modified:
   pkg/R/comm.phylo.cor.R
   pkg/man/color.plot.phylo.Rd
   pkg/man/comm.phylo.cor.Rd
Log:
Fix name matching in comm.phylo.cor

Modified: pkg/R/comm.phylo.cor.R
===================================================================
--- pkg/R/comm.phylo.cor.R	2008-04-17 05:28:46 UTC (rev 57)
+++ pkg/R/comm.phylo.cor.R	2008-04-25 23:41:34 UTC (rev 58)
@@ -11,7 +11,7 @@
 	phylo.dist <- as.dist(cophenetic(sample.prune(samp,phylo)))
 	pool.phylo.dist <- as.dist(cophenetic(phylo))
 	taxa.names <- rownames(as.matrix(phylo.dist))
-	samp.dist <- species.dist(samp,metric)
+	samp.dist <- as.dist(as.matrix(species.dist(samp,metric))[taxa.names,taxa.names])
 	results$obs.corr <- cor(phylo.dist,samp.dist,use="pairwise")
 	results$obs.corr.p <- cor.test(phylo.dist,samp.dist)$p.value
 	if (null.model=="sample.taxa.labels") for (run in 1:runs)

Modified: pkg/man/color.plot.phylo.Rd
===================================================================
--- pkg/man/color.plot.phylo.Rd	2008-04-17 05:28:46 UTC (rev 57)
+++ pkg/man/color.plot.phylo.Rd	2008-04-25 23:41:34 UTC (rev 58)
@@ -27,7 +27,7 @@
   If if \code{trait} is a factor then each level of the factor is plotted with the corresponding \code{col.names} value (if \code{length(num.breaks) > length(col.names)} colors are recycled.) If \code{trait} is not a factor then it is assumed to be continuous and \code{trait} is evenly divided into \code{num.breaks} levels.
 }
 \value{
-  The command is invoked for it's side effect, a plot of the \code{phylo} with tips colored based on \code{trait}
+  The command is invoked for its side effect, a plot of the \code{phylo} with tips colored based on \code{trait}
 }
 
 \author{ Peter Cowan <pdc at berkeley.edu> }

Modified: pkg/man/comm.phylo.cor.Rd
===================================================================
--- pkg/man/comm.phylo.cor.Rd	2008-04-17 05:28:46 UTC (rev 57)
+++ pkg/man/comm.phylo.cor.Rd	2008-04-25 23:41:34 UTC (rev 58)
@@ -14,20 +14,24 @@
 \arguments{
   \item{samp}{ Community data matrix }
   \item{phylo}{ Phylogenetic tree }
-  \item{metric}{ Metric of co-occurrence to use }
+  \item{metric}{ Metric of co-occurrence to use (see \code{\link{species.dist}})}
   \item{null.model}{ Null model to use }
   \item{runs}{ Number of runs (randomizations) }
 }
 \value{
-  \item{obs.corr }{Observed co-occurrence/phylogenetic distance correlation}
-    obs.corr.p
-    obs.rank
-    runs = runs
-    obs.rand.p
-    random.corrs = vector(length = runs)    
-  ...
+    A list with elements:
+    \item{obs.corr }{ Observed co-occurrence/phylogenetic distance correlation}
+    \item{obs.corr.p}{ P-value of observed correlation (standard P-value for correlation coefficient, not based on comparison with randomizations)}
+    \item{obs.rank}{ Rank of observed correlation vs. random}
+    \item{runs}{ Number of runs (randomizations) }
+    \item{obs.rand.p}{ P-value of observed correlation vs. randomizations (= obs.rank / (runs + 1))}
+    \item{random.corrs}{A vector of random correlation calculated for each run}
 }
 \references{ Cavender-Bares et al. 2004, 2006 }
 \author{ Steve Kembel <skembel at berkeley.edu> }
-\section{Warning }{Weighted null currently only works with presence-absence}
+\section{Warning }{ Weighted null model currently only works with presence-absence data. Convert your data before using this null model (e.g. \code{decostand(x,method="pa")})}
+\examples{
+data(phylocom)
+comm.phylo.cor(phylocom$sample, phylocom$phylo, metric="cij",null.model="sample.taxa.labels")
+}
 \keyword{univar}



More information about the Picante-commits mailing list