simbal: Simulate balanced and unbalanced trees.

Description Usage Arguments Details Value Examples

View source: R/simbal.r

Description

Simulate balanced and unbalanced trees.

Usage

1
2
  simbal(t = 10, metric = "colless", n = 10, cutlow = -0.5,
    cuthigh = 0.5)

Arguments

t

Number of tips (i.e., species). Defaults to 10 tips.

metric

Methods to use to generate trees, one of "colless", "beta", or gamma (see details). Defaults to "colless".

n

Number of trees to produce. Defaults to 10 trees.

cutlow

Value at which to filter trees on the low (e.g., unbalanced) side of the metric.

cuthigh

Value at which to filter trees on the high (e.g., balanced) side of the metric.

Details

See the apTreeshape package for a description of the beta-splitting metric. Both Colless' metric and beta describe the extent to which a tree is balanced or not.

Value

List of length n, each elemen of two parts (one is the balance metric, and the other is the phylogeny)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Simulate 20 trees, each with 10 tips (=species), then pull out trees and metrics,
# using the colless' statistic (fxn: colless) of the apTreeshape package
out <- simbal(t = 10, metric = "colless", n = 20, cutlow = -0.5, cuthigh = 0.5) # run it
out$bal # get the balanced trees
out$unbal # get the unbalanced trees

# Using beta-splitting (fxn: maxlik.betasplit) metric of the apTreeshape package
out <- simbal(t = 10, metric = "beta", n = 100, cutlow = -0.5, cuthigh = 0.5) # run it
out$bal # get the balanced trees
out$unbal # get the unbalanced trees

# Using gamma statistic (fxn: gammaStat) metric of the ape package
out <- simbal(t = 10, metric = "gamma", n = 100, cutlow = 1.6, cuthigh = 3) # run it
out$bal # get the trees with nodes close to root on average
out$unbal # get the trees with nodes close to the tips on average

sckott/treeshape documentation built on May 29, 2019, 4:07 p.m.