Learn R Programming

phangorn (version 1.5-0)

consensusNet: Computes a networx object from a collection of splits.

Description

Computes a networx object from a collection of splits.

Usage

consensusNet(obj, prob=.3, ...)
as.networx(x, ...)
## S3 method for class 'splits':
as.networx(x, ...)

Arguments

obj
An object of class multiPhylo.
prob
the proportion a split has to be present in all trees to be represented in the network.
x
An object of class splits.
...
Further arguments passed to or from other methods.

Value

  • as.networx returns an object of class networx. This is just an intermediate to plot phylogenetic networks with igraph.

References

Holland B.R., Huber K.T., Moulton V., Lockhart P.J. (2004) Using consensus networks to visualize contradictory evidence for species phylogeny. Molecular Biology and Evolution, 21, 1459--61

See Also

splitsNetwork, lento, distanceHadamard

Examples

Run this code
data(Laurasiatherian)
set.seed(1)
bs <- bootstrap.phyDat(Laurasiatherian, pratchet, k=1, bs=100, multicore=FALSE, trace=0)
class(bs) <- 'multiPhylo'
cnet = consensusNet(bs, .26)
plot(cnet, show.edge.label=TRUE)
open3d()
plot(cnet, show.tip.label=FALSE, show.nodes=TRUE)

set.seed(1)
tree1 = rtree(20, rooted=FALSE)
sp = as.splits(rNNI(tree1, n=10))
net = as.networx(sp)
open3d()
plot(net)

Run the code above in your browser using DataLab