]> git.donarmstrong.com Git - ape.git/commitdiff
some changes done before the HD failure of my laptop... I presume
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Mon, 18 Mar 2013 10:29:37 +0000 (10:29 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Mon, 18 Mar 2013 10:29:37 +0000 (10:29 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@210 6e262413-ae40-0410-9e79-b911bd7a66b7

NEWS
R/pic.R

diff --git a/NEWS b/NEWS
index 9bc3f6c8c56effb85d22da07d4d5fed2f086ee8d..adf30827a4c5d41dd71777d49292b68469e321d1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,12 @@ BUG FIXES
       distance matrix and itself.
 
 
+OTHER CHANGES
+
+    o The files CDAM.global.R and CDAM.post.R have been renamed
+      CADM.global.R and CADM.post.R
+
+
 
                CHANGES IN APE VERSION 3.0-7
 
diff --git a/R/pic.R b/R/pic.R
index bc54067da21b98782f183ac05b22afeb8a004618..2735f8f24ca82ade9e8a78c6a68a80a73906b56c 100644 (file)
--- a/R/pic.R
+++ b/R/pic.R
@@ -1,26 +1,24 @@
-## pic.R (2012-11-20)
+## pic.R (2013-02-18)
 
 ##   Phylogenetically Independent Contrasts
 
-## Copyright 2002-2012 Emmanuel Paradis
+## Copyright 2002-2013 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
 
 pic <- function(x, phy, scaled = TRUE, var.contrasts = FALSE, rescaled.tree = FALSE)
 {
-    if (!inherits(phy, "phylo"))
-      stop("object 'phy' is not of class \"phylo\"")
-    if (is.null(phy$edge.length))
-      stop("your tree has no branch lengths")
+    if (!inherits(phy, "phylo")) stop("object 'phy' is not of class \"phylo\"")
+    if (is.null(phy$edge.length)) stop("your tree has no branch lengths")
     nb.tip <- length(phy$tip.label)
     nb.node <- phy$Nnode
     if (nb.node != nb.tip - 1)
-      stop("'phy' is not rooted and fully dichotomous")
+        stop("'phy' is not rooted and fully dichotomous")
     if (length(x) != nb.tip)
-      stop("length of phenotypic and of phylogenetic data do not match")
+        stop("length of phenotypic and of phylogenetic data do not match")
     if (any(is.na(x)))
-      stop("missing data in 'x': you may consider removing the species with missing data from your tree with the function 'drop.tip'.")
+        stop("missing data in 'x': you may consider removing the species with missing data from your tree with the function 'drop.tip'.")
 
     phy <- reorder(phy, "postorder")
     phenotype <- numeric(nb.tip + nb.node)
@@ -65,7 +63,7 @@ pic.ortho <- function(x, phy, var.contrasts = FALSE, intra = FALSE)
 {
     n <- length(x)
     m <- n - 1L # number of nodes
-    phy <- reorder(phy, "pruningwise")
+    phy <- reorder(phy, "postorder")
     xx <- unlist(lapply(x, mean)) # 'x' in Felsenstein's paper
     xx <- c(xx, numeric(m))
     delta.v <- numeric(n + m)