[Adephylo-commits] r66 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 2 15:38:48 CET 2008


Author: jombart
Date: 2008-12-02 15:38:48 +0100 (Tue, 02 Dec 2008)
New Revision: 66

Modified:
   pkg/R/proximities.R
   pkg/man/proxTips.Rd
Log:
Abouheif fixes



Modified: pkg/R/proximities.R
===================================================================
--- pkg/R/proximities.R	2008-12-02 14:27:04 UTC (rev 65)
+++ pkg/R/proximities.R	2008-12-02 14:38:48 UTC (rev 66)
@@ -2,7 +2,7 @@
 # proxTips
 ###########
 proxTips <- function(x, tips="all",
-                      method=c("patristic","nNodes","Abouheif1","Abouheif2","sumDD"),
+                      method=c("patristic","nNodes","oriAbouheif","Abouheif","sumDD"),
                      a=1, normalize=c("row","col","none"), symmetric=TRUE){
 
     if(!require(phylobase)) stop("phylobase package is not installed")
@@ -20,7 +20,11 @@
     if(any(is.na(tips))) stop("wrong tips specified")
 
     ## compute distances
-    D <- distTips(x, tips=tips, method=method)
+    distMethod <- method
+    if(length(grep("Abouheif", distMethod)>1)){
+        distMethod <- "Abouheif"
+    }
+    D <- distTips(x, tips=tips, method=distMethod)
     D <- as.matrix(D)
 
     ## compute proximities
@@ -28,9 +32,9 @@
     diag(res) <- 0
 
     ## handle Abouheif with diagonal (Abouheif1)
-    if(method=="Abouheif1"){
-        sumMarg <- apply(D,1,sum)
-        diag(res) <- sumMarg
+    if(method=="oriAbouheif"){
+        sumMarg <- apply(res,1,sum)
+        diag(res) <- (1-sumMarg)
         normalize <- "none" # not needed (already bistochastic)
         symmetric <- FALSE # not needed (aleady symmetric)
     }

Modified: pkg/man/proxTips.Rd
===================================================================
--- pkg/man/proxTips.Rd	2008-12-02 14:27:04 UTC (rev 65)
+++ pkg/man/proxTips.Rd	2008-12-02 14:38:48 UTC (rev 66)
@@ -36,7 +36,7 @@
   where '...' is the non-autoregressive part of the model, and 'e' are residuals.
 }
 \usage{
-proxTips(x, tips, method=c("patristic","nNodes","Abouheif1","Abouheif2","sumDD"),
+proxTips(x, tips, method=c("patristic","nNodes","oriAbouheif","Abouheif","sumDD"),
          a=1, normalize=c("row","col","none"), symmetric=TRUE)
 }
 \arguments{
@@ -50,8 +50,8 @@
     possible values are:\cr
     - \code{patristic}: (inversed sum of) branch length \cr
     - \code{nNodes}: (inversed) number of nodes on the path between the nodes \cr
-    - \code{Abouheif1}: Abouheif's proximity with diagonal (see details) \cr
-    - \code{Abouheif2}: Abouheif's proximity without diagonal (see details) \cr
+    - \code{oriAbouheif}: original Abouheif's proximity, with diagonal (see details) \cr
+    - \code{Abouheif}: Abouheif's proximity without diagonal (see details) \cr
    - \code{sumDD}: (inversed) sum of direct descendants of all nodes on the path
     (see details) \cr
   }
@@ -79,12 +79,12 @@
   all the nodes in the path going from \code{node1} to \code{node2}. Let
   DDP be the number of direct descendants from each node in P. Then, the
   so-called 'Abouheif' distance is the inverse of the product of all
-  terms in DDP. \code{Abouheif1} returns a matrix with non-null diagonal
-  element, as formulated in Pavoine \emph{et al.} (2008). This matrix is
+  terms in DDP. \code{oriAbouheif} returns a matrix with non-null diagonal
+  elements, as formulated in Pavoine \emph{et al.} (2008). This matrix is
   bistochastic (all marginal sums equal 1), but this bilinear
   symmetric form does not give rise to a Moran's index, since it
-  requires a null diagonal. \code{Abouheif2} contains Abouheif's
-  proximity but has a null diagonal, giving rise to a Moran's index.\cr
+  requires a null diagonal. \code{Abouheif} contains Abouheif's
+  proximities but has a null diagonal, giving rise to a Moran's index.\cr
 
    \code{sumDD} refers to a phylogenetic proximity quite similar to that
   of Abouheif. We consider the same sets P and DDP. But instead of



More information about the Adephylo-commits mailing list