Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

checkPhylo4

Validity checking for phylo4 objects


Description

Basic checks on the validity of S4 phylogenetic objects

Usage

checkPhylo4(object)

Arguments

object

A prospective phylo4 or phylo4d object

Value

As required by validObject, returns an error string (describing problems) or TRUE if everything is OK.

Note

These functions are only intended to be called by other phylobase functions.

checkPhylo4 is an (inflexible) wrapper for checkTree. The rules for phylo4 objects essentially follow those for phylo objects from the ape package, which are in turn defined in http://ape-package.ird.fr/misc/FormatTreeR_24Oct2012.pdf. These are essentially that:

  • if the tree has edge lengths defined, the number of edge lengths must match the number of edges;

  • the number of tip labels must match the number of tips;

  • in a tree with ntips tips and nnodes (total) nodes, nodes 1 to ntips must be tips

  • if the tree is rooted, the root must be node number ntips+1 and the root node must be the first row of the edge matrix

  • tip labels, node labels, edge labels, edge lengths must have proper internal names (i.e. internal names that match the node numbers they document)

  • tip and node labels must be unique

You can alter some of the default options by using the function phylobase.options.

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.

Author(s)

Ben Bolker, Steven Kembel, Francois Michonneau

See Also

the phylo4 constructor and phylo4 class; the phylo4d-methods constructor and the phylo4d class do checks for the data associated with trees. See coerce-methods for translation functions and phylobase.options to change some of the default options of the validator.


phylobase

Base Package for Phylogenetic Structures and Comparative Data

v0.8.10
GPL (>= 2)
Authors
R Hackathon et al. (alphabetically: Ben Bolker, Marguerite Butler, Peter Cowan, Damien de Vienne, Dirk Eddelbuettel, Mark Holder, Thibaut Jombart, Steve Kembel, Francois Michonneau, David Orme, Brian O'Meara, Emmanuel Paradis, Jim Regetz, Derrick Zwickl)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.