[Picante-commits] r182 - pkg pkg/R pkg/man www

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 18 19:53:50 CET 2009


Author: skembel
Date: 2009-03-18 19:53:50 +0100 (Wed, 18 Mar 2009)
New Revision: 182

Modified:
   pkg/DESCRIPTION
   pkg/R/cor.table.R
   pkg/R/phylodiversity.R
   pkg/man/color.plot.phylo.Rd
   pkg/man/cor.table.Rd
   pkg/man/picante-package.Rd
   www/index.php
Log:
Bugfixes to pd and cor.table. Docs for color.plot.phylo update. Prepare for 0.6-1 release

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2009-02-24 22:30:14 UTC (rev 181)
+++ pkg/DESCRIPTION	2009-03-18 18:53:50 UTC (rev 182)
@@ -1,8 +1,8 @@
 Package: picante
 Type: Package
 Title: R tools for integrating phylogenies and ecology
-Version: 0.6-0
-Date: 2009-2-24
+Version: 0.6-1
+Date: 2009-3-18
 Author: Steven Kembel <skembel at uoregon.edu>, David Ackerly <dackerly at berkeley.edu>, Simon Blomberg <s.blomberg1 at uq.edu.au>, Peter Cowan <pdc at berkeley.edu>, Matthew Helmus <mrhelmus at wisc.edu>, Helene Morlon  <morlon.helene at gmail.com>, Campbell Webb <cwebb at oeb.harvard.edu>
 Maintainer: Steven Kembel <skembel at uoregon.edu>
 Depends: ape, vegan, nlme

Modified: pkg/R/cor.table.R
===================================================================
--- pkg/R/cor.table.R	2009-02-24 22:30:14 UTC (rev 181)
+++ pkg/R/cor.table.R	2009-03-18 18:53:50 UTC (rev 182)
@@ -1,20 +1,21 @@
-cor.table <- function (x, cor.method = "pearson", cor.type=c("standard","contrast")) 
+cor.table <- function (x, cor.method = c("pearson","spearman"),
+    cor.type = c("standard", "contrast")) 
 {
+    cor.method <- match.arg(cor.method)
     cor.type <- match.arg(cor.type)
-    if (identical(cor.type,"standard")) {
+    if (identical(cor.type, "standard")) {
         concorr <- list()
         concorr$r <- cor(x, method = cor.method)
         concorr$df <- dim(x)[1] - 2
-        t <- concorr$r * sqrt(concorr$df/(1 - concorr$r^2))
-        concorr$P <- dt(t, concorr$df)
-        concorr
+
     }
     else {
-    	concorr <- list()
-        concorr$r <- cor(rbind(x,x*-1),method=cor.method)
-        concorr$df <- length(x[,1])-1
-        t <- concorr$r * sqrt(concorr$df/(1-concorr$r^2))
-        concorr$P <- dt(t,concorr$df)
-        concorr
+        concorr <- list()
+        concorr$r <- cor(rbind(x, x * -1), method = cor.method)
+        concorr$df <- length(x[, 1]) - 1
     }
+    t <- concorr$r * sqrt(concorr$df/(1 - concorr$r^2))
+    concorr$P <- 2*pt(t, concorr$df)
+    concorr$P[concorr$r>0]<-2*pt(t[concorr$r>0], concorr$df,lower.tail=FALSE)
+    concorr
 }

Modified: pkg/R/phylodiversity.R
===================================================================
--- pkg/R/phylodiversity.R	2009-02-24 22:30:14 UTC (rev 181)
+++ pkg/R/phylodiversity.R	2009-03-18 18:53:50 UTC (rev 182)
@@ -458,7 +458,7 @@
     
     # numbers of locations and species
     species<-colnames(samp)
-    SR<-rowSums(samp)
+    SR <- rowSums(ifelse(samp>0,1,0))
     nlocations=dim(samp)[1]
     nspecies=dim(samp)[2]
     

Modified: pkg/man/color.plot.phylo.Rd
===================================================================
--- pkg/man/color.plot.phylo.Rd	2009-02-24 22:30:14 UTC (rev 181)
+++ pkg/man/color.plot.phylo.Rd	2009-03-18 18:53:50 UTC (rev 182)
@@ -5,10 +5,16 @@
   Plots a phylogeny with tip labels colored to indicate continuous or discrete trait values}
 \usage{
   color.plot.phylo(phylo, df, trait, taxa.names,
-        num.breaks = ifelse(is.factor(df[, trait]), length(levels(df[,trait])), 12),
-        col.names = rainbow(ifelse(is.vector(num.breaks), length(num.breaks) - 1, num.breaks)),
-        cut.labs = NULL, leg.title = NULL, main = trait, leg.cex = 1,
-        tip.labs = NULL, ...)}
+                    num.breaks = ifelse(is.factor(df[,trait]),
+                        length(levels(df[,trait])), 12),
+                    col.names = rainbow(ifelse(length(num.breaks) > 1, length(num.breaks) - 1, num.breaks)),
+                    cut.labs = NULL,
+                    leg.title = NULL,
+                    main = trait,
+                    leg.cex = 1,
+                    tip.labs = NULL,
+                    ...)
+        }
 \arguments{
   \item{phylo}{An object of class \code{phylo}}
   \item{df}{A dataframe containing the traits to be plotted}

Modified: pkg/man/cor.table.Rd
===================================================================
--- pkg/man/cor.table.Rd	2009-02-24 22:30:14 UTC (rev 181)
+++ pkg/man/cor.table.Rd	2009-03-18 18:53:50 UTC (rev 182)
@@ -5,7 +5,8 @@
   Table of correlations with associated P-values and df, can be used with regular or independent contrast data
 }
 \usage{
-cor.table(x, cor.method = "pearson", cor.type=c("standard","contrast")) 
+cor.table(x, cor.method = c("pearson","spearman"),
+    cor.type=c("standard","contrast")) 
 }
 
 \arguments{

Modified: pkg/man/picante-package.Rd
===================================================================
--- pkg/man/picante-package.Rd	2009-02-24 22:30:14 UTC (rev 181)
+++ pkg/man/picante-package.Rd	2009-03-18 18:53:50 UTC (rev 182)
@@ -12,8 +12,8 @@
 \tabular{ll}{
 Package: \tab picante\cr
 Type: \tab Package\cr
-Version: \tab 0.6-0\cr
-Date: \tab 2009-2-24\cr
+Version: \tab 0.6-1\cr
+Date: \tab 2009-3-18\cr
 License: \tab GPL-2\cr
 }
 }

Modified: www/index.php
===================================================================
--- www/index.php	2009-02-24 22:30:14 UTC (rev 181)
+++ www/index.php	2009-03-18 18:53:50 UTC (rev 182)
@@ -38,7 +38,8 @@
 
 <h2>News</h2>
 <ul>
-<li>The pd and phylosor functions in version 0.5 of picante could result in incorrect calculation of phylosor in cases where the supplied phylogeny included taxa not present in any sample, or when pairs of samples collectively contained all taxa in the phylogeny. These functions have been updated in version 0.6, please see the documentation for more information about how PD and phylosor are calculated. Thanks to Catherine Graham, Nick Matzke, Juan Parra, and Marten Winter for feedback and bug reports on this issue.
+<li>The pd and phylosor functions in version 0.5 of picante could result in incorrect calculation of phylosor in cases where the supplied phylogeny included taxa not present in any sample, or when pairs of samples collectively contained all taxa in the phylogeny. These functions have been updated in version 0.6, please see the documentation for more information about how PD and phylosor are calculated.</li>
+<li>Thanks to Catherine Graham, Nathaniel Hallinan, Nick Matzke, Alain Paquette, Juan Parra, and Marten Winter for feedback and bug reports.</li>
 </li>
 </ul>
 



More information about the Picante-commits mailing list