checkPhylo4 {phylobase} | R Documentation |
Basic checks on the validity of S4 phylogenetic objects
checkPhylo4(object) checkTree(object, warn=c("retic","singleton","multiroot"), err=NULL) checkPhylo4Data(object)
object |
A prospective phylo4 or phylo4d object |
warn |
a character vector listing phenomena to warn about:
current options are ["poly" (polytomies),
"retic" (reticulations),
"singleton" ("singleton" nodes, i.e.
nodes with a single descendant), "multiroot"
(multiple roots) ] |
err |
a character vector listing phenomena to trigger errors: choices as above |
As required by validObject
, returns an
error string (describing problems) or TRUE if everything is OK.
These functions are only intended to be called by other phylobase functions.
checkPhylo4
is an (inflexible) wrapper for
checkTree
, which uses the default settings.
The rules for phylo4
objects essentially follow
those for phylo
objects from the ape
package,
which are in turn defined in
http://ape.mpl.ird.fr/misc/FormatTreeR_4Dec2006.pdf.
These are essentially that:
ntips
tips and nnodes
(total)
nodes, nodes 1 to ntips
must be tips
ntips+1
and the root node must be the first row of the edge
matrix
For phylo4d
objects, checkTree
also calls
checkPhylo4Data
to check the validity of the data associated
with the tree. It ensures that (1) the data associated with the tree
have the correct dimensions, (2) that the row names for the data are
correct.
Ben Bolker, Steven Kembel, Francois Michonneau
the phylo4
constructor and phylo4 class;
formatData
, the phylo4d
constructor and
the phylo4d class do checks for the data associated with trees.
See coerce-methods
for translation functions.