o An error was fixed in the computation of ancestral character
states by generalized least squares in ace().
o An error was fixed in the computation of ancestral character
states by generalized least squares in ace().
+ o di2multi() did not modify node labels correctly.
+
+ o multi2di() failed if the tree had its attribute "order" set to
+ "cladewise".
+
CHANGES IN APE VERSION 2.1-2
CHANGES IN APE VERSION 2.1-2
Package: ape
Version: 2.1-3
Package: ape
Version: 2.1-3
Title: Analyses of Phylogenetics and Evolution
Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong,
Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel,
Title: Analyses of Phylogenetics and Evolution
Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong,
Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel,
-## multi2di.R (2007-08-02)
+## multi2di.R (2008-03-17)
## Collapse and Resolve Multichotomies
## Collapse and Resolve Multichotomies
-## Copyright 2005-2007 Emmanuel Paradis
+## Copyright 2005-2008 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
phy$edge <- rbind(phy$edge[-edge2delete, ], new.edge)
if (wbl)
phy$edge.length <- c(phy$edge.length[-edge2delete], new.edge.length)
phy$edge <- rbind(phy$edge[-edge2delete, ], new.edge)
if (wbl)
phy$edge.length <- c(phy$edge.length[-edge2delete], new.edge.length)
+ if (!is.null(attr(phy, "order"))) attr(phy, "order") <- NULL
+ print(phy$node.label)
+ if (!is.null(phy$node.label))
+ phy$node.label <-
+ c(phy$node.label, rep("", phy$Nnode - length(phy$node.label)))
+ print(phy$node.label)
reorder(phy)
##read.tree(text = write.tree(phy))
}
reorder(phy)
##read.tree(text = write.tree(phy))
}
sel <- phy$edge > min(node2del)
for (i in which(sel))
phy$edge[i] <- phy$edge[i] - sum(node2del < phy$edge[i])
sel <- phy$edge > min(node2del)
for (i in which(sel))
phy$edge[i] <- phy$edge[i] - sum(node2del < phy$edge[i])
+ if (!is.null(phy$node.label))
+ phy$node.label <- phy$node.label[-(node2del - length(phy$tip.label))]
}
\references{
Paradis, E. (2007) A Bit-Level Coding Scheme for Nucleotides.
}
\references{
Paradis, E. (2007) A Bit-Level Coding Scheme for Nucleotides.
- \url{http://pbil.univ-lyon1.fr/R/ape/misc/BitLevelCodingScheme_20April2007.pdf}
+ \url{http://ape.mpl.ird.fr/misc/BitLevelCodingScheme_20April2007.pdf}
}
\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
\seealso{
}
\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
\seealso{
\title{Collapse and Resolve Multichotomies}
\description{
These two functions collapse or resolve multichotomies in phylogenetic
\title{Collapse and Resolve Multichotomies}
\description{
These two functions collapse or resolve multichotomies in phylogenetic
- trees (objects of class \code{"phylo"}).
}
\usage{
multi2di(phy, random = TRUE)
}
\usage{
multi2di(phy, random = TRUE)
\url{http://evolution.genetics.washington.edu/phylip/newick_doc.html}
Paradis, E. (2006) Definition of Formats for Coding Phylogenetic Trees
\url{http://evolution.genetics.washington.edu/phylip/newick_doc.html}
Paradis, E. (2006) Definition of Formats for Coding Phylogenetic Trees
- in R. \url{http://pbil.univ-lyon1.fr/R/ape/misc/FormatTreeR_4Dec2006.pdf}
+ in R. \url{http://ape.mpl.ird.fr/misc/FormatTreeR_4Dec2006.pdf}
}
\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
}
\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
-/* reorder_phylo.c 2006-10-11 */
+/* reorder_phylo.c 2008-03-17 */
-/* Copyright 2006 Emmanuel Paradis */
+/* Copyright 2008 Emmanuel Paradis */
/* This file is part of the R-package `ape'. */
/* See the file ../COPYING for licensing issues. */
/* This file is part of the R-package `ape'. */
/* See the file ../COPYING for licensing issues. */
done = (int*)R_alloc(*N, sizeof(int));
node_back = (int*)R_alloc(*N + 2 - *n, sizeof(int));
done = (int*)R_alloc(*N, sizeof(int));
node_back = (int*)R_alloc(*N + 2 - *n, sizeof(int));
- for (i = 0; i < *N; i++) done[i] = 0;
+ memset(done, 0, *N * sizeof(int));
node = *n + 1;
while (j < *N) {
for (i = 0; i < *N; i++) {
node = *n + 1;
while (j < *N) {
for (i = 0; i < *N; i++) {
/* use `nextI' temporarily because need an address for R_tabulate */
nextI = *ntip + *nnode;
Ndegr = (int*)R_alloc(nextI, sizeof(int));
/* use `nextI' temporarily because need an address for R_tabulate */
nextI = *ntip + *nnode;
Ndegr = (int*)R_alloc(nextI, sizeof(int));
- for (i = 0; i < nextI; i++) Ndegr[i] = 0;
+ memset(Ndegr, 0, nextI*sizeof(int));
R_tabulate(edge1, nedge, &nextI, Ndegr);
/* `ready' indicates whether an edge is ready to be */
R_tabulate(edge1, nedge, &nextI, Ndegr);
/* `ready' indicates whether an edge is ready to be */