Network manipulation

The package contains many utilities to extract information about phylogenetic networks, and to modify networks. Functions that are not exported are more likely to experience breaking changes in future versions, but can be used by prefixing their name with PhyloNetworks. .

Below is a list of the most useful functions. They typically assume a bicombining network, that is, a network in which each hybrid node has exactly 2 parents (never more).

Getting information on a network

overall network information

The following functions all compute distances from the root to each node. Their differ in how they handle time inconsistency: when the distance from the root to a node varies across multiple paths from the root to that node.

node information

To learn about nodes and how some might be related or connected, one can use:

To learn about the edges connected to a given node, one can use:

edge information

To learn about the nodes related connected to a given edge, one can use the following functions:

Modifying a network

To modify some of the core components of a network:

To remove components from a network:

To add components to a network:

To modify some internal attributes, that don't affect the network topology or edge parameters:

To calibrate a network (modify its edge lengths):

Comparing two networks

  • hardwiredclusterdistance: extends the Robinson-Foulds distance. It's a dissimilarity measure on networks: a dissimilarity of 0 does not guarantee that the 2 networks have the same topology in general. But it does if the networks are in some classes (e.g. trees, level-1, tree-child, and others).