testEdgeMat | R Documentation |
phylo
' Phylogeny Object for InconsistenciestestEdgeMat
is a small simple function which tests
the $edge
matrix of phylo
objects for
inconsistencies that can cause downstream analytical problems.
The associated function, cleanNewPhylo
puts an input
phylo
object, presumably freshly created or
reconstituted by some function, through a series
of post-processing, This includes having singles collapsed,
nodes reordered and being written out as a Newick string and read back in,
to ensure functionality with ape functions
and ape
-derived functions.
testEdgeMat(tree) cleanNewPhylo(tree)
tree |
A phylogeny object of type |
Useful when doing complex manipulations of phylo
objects (or reconstituting them, or their
de novo construction), and thus is used by a number of paleotree
functions.
For testEdgeMat
, if all the checks in the function pass correctly,
the logical TRUE
is returned.
For cleanNewPhylo
, an object of class phylo
is returned.
David W. Bapst, with a large number of tests incorporated from
Emmanuel Paradis's checkValidPhylo
function in package ape
,
(released under the GPL v>2).
set.seed(444) tree <- rtree(10) # should return TRUE testEdgeMat(tree) # should also work on star trees testEdgeMat(stree(10)) # should also work on trees with two taxa testEdgeMat(rtree(2)) # should also work on trees with one taxon testEdgeMat(stree(1)) #running cleanNewPhylo on this tree should have little effect #beyond ladderizing it... tree1 <- cleanNewPhylo(tree) #compare outputs layout(1:2) plot(tree) plot(tree1) layout(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.