section_the_tree: Section a tree for stratified analysis

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_stratified_v1.R

Description

A utility function for stratified analysis. Sections the tree into a series of strata. Each stratum may have one or more subtrees (APE phylo3 objects, *WITH* root edges) and/or branch segments (which are just represented as numeric values, indicating the length of the sub-branch, i.e. the time-width of the stratum, if the branch crosses the whole stratum.

Usage

1
2
3
  section_the_tree(inputs, make_master_table = FALSE,
    plot_pieces = TRUE, cut_fossils = TRUE,
    fossils_older_than = 0.6)

Arguments

inputs

The list of inputs for stratified analysis

make_master_table

If desired, make an inputs$master_table containing the correspondance between the original tree and the sectioned pieces.

plot_pieces

If TRUE, plot the tree chunks (but not isolated branch segments) as they are created.

cut_fossils

If TRUE (default), the program is stopped if there are fossils, i.e. tips older than 0.6 my (default). Users should use codedrop.tip or an external program to clip fossils out of the tree. PLEASE NOTE that several times I have experienced miserable long nights due, apparently, to drop.tip producing weird tree structures, resulting in weird Newick files, without me realizing it. The solution is usually to open the Newick file in something like FigTree, resort the branches, and save to a new Newick file. Fossils have now been implemented in stratified analysis; this was complicated, as it involves inserting new branches in chopped trees.

fossils_older_than

Tips that are older than fossils_older_than will be marked as TRUE in a column called fossil. This is not currently set to 0, because Newick files can have slight precision issues etc. that mean not all tips quite come to zero. You can attempt to fix this with extend_tips_to_ultrametricize (but make sure you do not inappropriately average in fossils!!).

Value

inputs with inputs$tree_sections_list added.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Matzke_2012_IBS

See Also

prt, chainsaw2, drop.tip

Examples

1
test=1

Example output

Loading required package: rexpokit
Loading required package: SparseM

Attaching package: 'SparseM'

The following object is masked from 'package:base':

    backsolve

Loading required package: Rcpp
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.