[Adephylo-commits] r121 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 19 12:00:06 CET 2009


Author: jombart
Date: 2009-01-19 12:00:06 +0100 (Mon, 19 Jan 2009)
New Revision: 121

Modified:
   pkg/R/abouheif.R
   pkg/R/distances.R
   pkg/R/orthobasis.R
   pkg/R/orthogram.R
   pkg/R/partition.R
   pkg/R/ppca.R
   pkg/R/proximities.R
   pkg/R/table.phylo4d.R
   pkg/R/utils.R
Log:
Changes in naming conventions in phylobase.
pkg check is ok with the 2 usual warnings.
Changes are as follow:
from  ->  to
attach_data    attachData
check_data    checkData
check_phylo4    checkPhylo4
check_tree    checkTree
getedges    getEdge
hasSingles    hasSingle


Modified: pkg/R/abouheif.R
===================================================================
--- pkg/R/abouheif.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/abouheif.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -14,8 +14,8 @@
         W <- as.matrix(W)
     } else { # otherwise computed W from x, a phylo4d object
         if(!inherits(x, "phylo4d")) stop("if W is not provided, x has to be a phylo4d object")
-        if (is.character(chk <- check_phylo4(x))) stop("bad phylo4d object: ",chk)
-        if (is.character(chk <- check_data(x))) stop("bad phylo4d object: ",chk)
+        if (is.character(chk <- checkPhylo4(x))) stop("bad phylo4d object: ",chk)
+        if (is.character(chk <- checkData(x))) stop("bad phylo4d object: ",chk)
         W <- proxTips(x, method=method, a=a, normalize="row", symmetric=TRUE)
     }
 
@@ -25,8 +25,8 @@
 
     ## take data from x if it is a phylo4d
     if(inherits(x, "phylo4d")){
-        if (is.character(chk <- check_phylo4(x))) stop("bad phylo4d object: ",chk)
-        if (is.character(chk <- check_data(x))) stop("bad phylo4d object: ",chk)
+        if (is.character(chk <- checkPhylo4(x))) stop("bad phylo4d object: ",chk)
+        if (is.character(chk <- checkData(x))) stop("bad phylo4d object: ",chk)
         x <- tdata(x)
     }
 

Modified: pkg/R/distances.R
===================================================================
--- pkg/R/distances.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/distances.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -15,7 +15,7 @@
     tips.names <- names(tips)
 
     ## some checks
-    if (is.character(checkval <- check_phylo4(x))) stop(checkval)
+    if (is.character(checkval <- checkPhylo4(x))) stop(checkval)
     if(any(is.na(tips))) stop("wrong tips specified")
 
     ## create all couples of observations
@@ -52,7 +52,7 @@
                           c(allPath[[i]], allPairs[i,1], allPairs[i,2]) )
         names(allPath) <- allPath.names
 
-        edge.idx <- lapply(allPath, function(e) getedges(x, e) ) # list of indices of edges
+        edge.idx <- lapply(allPath, function(e) getEdge(x, e) ) # list of indices of edges
         allEdgeLength <- edgeLength(x)
         res <- lapply(edge.idx, function(idx) sum(allEdgeLength[idx], na.rm=TRUE) )
     } # end patristic
@@ -116,7 +116,7 @@
     root <- getNode(x, N+1) # so that we have a named node
 
     ## some checks
-    if(is.character(checkval <- check_phylo4(x))) stop(checkval)
+    if(is.character(checkval <- checkPhylo4(x))) stop(checkval)
     if(any(is.na(tips))) stop("wrong tips specified")
 
 
@@ -133,7 +133,7 @@
         allPath <- lapply(1:length(allPath), function(i) c(allPath[[i]], tips[i]) )
         names(allPath) <- allPath.names
 
-        edge.idx <- lapply(allPath, function(e) getedges(x, e) ) # list of indices of edges
+        edge.idx <- lapply(allPath, function(e) getEdge(x, e) ) # list of indices of edges
         allEdgeLength <- edgeLength(x)
         res <- sapply(edge.idx, function(idx) sum(allEdgeLength[idx], na.rm=TRUE) )
     } # end patristic

Modified: pkg/R/orthobasis.R
===================================================================
--- pkg/R/orthobasis.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/orthobasis.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -11,7 +11,7 @@
 
     if(is.null(prox)){ # have to compute prox
         x <- as(x, "phylo4")
-        if (is.character(checkval <- check_phylo4(x))) stop(checkval)
+        if (is.character(checkval <- checkPhylo4(x))) stop(checkval)
         W <- proxTips(x, tips="all", method=method, a=a, normalize="row", symmetric=TRUE)
     } else { # prox is provided
         W <- as.matrix(prox)

Modified: pkg/R/orthogram.R
===================================================================
--- pkg/R/orthogram.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/orthogram.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -41,7 +41,7 @@
             ## check that tre is provided and valid
             if(is.null(tre)) stop("tre, orthobasis or prox must be provided")
             tre <- as(tre, "phylo4")
-            if (is.character(checkval <- check_phylo4(tre))) stop(checkval)
+            if (is.character(checkval <- checkPhylo4(tre))) stop(checkval)
             orthobas <- treePart(tre, result="orthobasis")
         } else { # else orthobasis from the proxi matrix.
             orthobas <- orthobasis.phylo(prox=prox)

Modified: pkg/R/partition.R
===================================================================
--- pkg/R/partition.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/partition.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -17,7 +17,7 @@
     x <- as(x, "phylo4")
 
     ## check phylo4 object
-    if (is.character(checkval <- check_phylo4(x))) stop(checkval)
+    if (is.character(checkval <- checkPhylo4(x))) stop(checkval)
 
     ## computations
     nodIdx <- nTips(x)+1
@@ -44,7 +44,7 @@
     result <- match.arg(result)
 
     ## check phylo4 object
-    if (is.character(checkval <- check_phylo4(x))) stop(checkval)
+    if (is.character(checkval <- checkPhylo4(x))) stop(checkval)
 
     n <- nTips(x) # number of tips
     HTU.idx <- (n+1):(n+nNodes(x)) # index of internal nodes (HTU)

Modified: pkg/R/ppca.R
===================================================================
--- pkg/R/ppca.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/ppca.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -11,8 +11,8 @@
 
     ## handle arguments
     if(!require(ade4)) stop("The package ade4 is not installed.")
-    if (is.character(chk <- check_phylo4(x))) stop("bad phylo4d object: ",chk)
-    if (is.character(chk <- check_data(x))) stop("bad phylo4d object: ",chk)
+    if (is.character(chk <- checkPhylo4(x))) stop("bad phylo4d object: ",chk)
+    if (is.character(chk <- checkData(x))) stop("bad phylo4d object: ",chk)
 
     tre <- as(x, "phylo4")
     method <- match.arg(method)

Modified: pkg/R/proximities.R
===================================================================
--- pkg/R/proximities.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/proximities.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -16,7 +16,7 @@
     tips <- getNode(x, tips)
 
     ## some checks
-    if (is.character(checkval <- check_phylo4(x))) stop(checkval)
+    if (is.character(checkval <- checkPhylo4(x))) stop(checkval)
     if(any(is.na(tips))) stop("wrong tips specified")
 
     ## compute distances

Modified: pkg/R/table.phylo4d.R
===================================================================
--- pkg/R/table.phylo4d.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/table.phylo4d.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -10,8 +10,8 @@
 {
 
     ## preliminary stuff and checks
-    if (is.character(chk <- check_phylo4(x))) stop("bad phylo4d object: ",chk)
-    # if (is.character(chk <- check_data(x))) stop("bad phylo4d object: ",chk) <- needed?
+    if (is.character(chk <- checkPhylo4(x))) stop("bad phylo4d object: ",chk)
+    # if (is.character(chk <- checkData(x))) stop("bad phylo4d object: ",chk) <- needed?
 
     if(!require(ape)) stop("the ape package is required")
     if(cex.label<0.1) {

Modified: pkg/R/utils.R
===================================================================
--- pkg/R/utils.R	2009-01-12 14:11:37 UTC (rev 120)
+++ pkg/R/utils.R	2009-01-19 11:00:06 UTC (rev 121)
@@ -48,7 +48,7 @@
     x <- as(x, "phylo4")
 
     ## some checks
-    if (is.character(checkval <- check_phylo4(x))) stop(checkval)
+    if (is.character(checkval <- checkPhylo4(x))) stop(checkval)
     t1 <- getNode(x, tip1)
     t2 <- getNode(x, tip2)
     if(any(is.na(c(t1,t2)))) stop("wrong tip specified")
@@ -170,7 +170,7 @@
     nameBy <- match.arg(nameBy)
 
     ## check phylo4 object
-    if (is.character(checkval <- check_phylo4(x))) stop(checkval)
+    if (is.character(checkval <- checkPhylo4(x))) stop(checkval)
 
     ## computations
     nodIdx <- nTips(x)+1



More information about the Adephylo-commits mailing list