make_spmat_row: Construct a (text) cell of the cladogenesis/speciation matrix

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

View source: R/BioGeoBEARS_basics_v1.R

Description

Given the identity of the states/geographic ranges on the left branch (Lstates), right branch (Rstates), and ancestral areas (ancareas_txt_tmp), construct the (text version) of the row of transition probabilities. This means that each nonzero cell gets a v for a vicariance event, a y for a sympatric speciation/range-copying event, a j for a founder-event/jump speciation event, and an s for a sympatric-subset event.

Usage

1
2
  make_spmat_row(Lstates, Rstates, ancareas_txt_tmp,
    splitval = "", code_for_overlapping_subsets = NA)

Arguments

Lstates

A string listing the possible left states, which will be split by splitval.

Rstates

A string listing the possible right states, which will be split by splitval.

ancareas_txt_tmp

A string listing the possible ancestral states, which will be split by splitval.

splitval

The character to split on.

code_for_overlapping_subsets

Hypothetically, there is no reason that a vicariance event could happen, e.g. ABC–>AB, BC. This is disallowed in LAGRANGE BioGeoBEARS defaults, and, if one is going to employ the construct of discrete areas in the first place, overlaps should probably be avoided. But this parameter will allow experimentation. Here, code_for_overlapping_subsets=NA equals the default, and any other value means that overlapping vicariance events are included, with a number describing the number of areas in the overlap. Users could then manually convert this to a probability according to some function.

Details

This function is utilized by apply in other functions (e.g. ) in an attempt to speed up calculation over rows. However, processing of text formulas via apply will never be fast enough for large matrices; see cladoRcpp for optimized functions.

This text-based matrix later gets evaluated by other functions to calculate the numerical probabilities. I.e., if j=0 and the other forms of speciation have weights equal to each other, this is the LAGRANGE cladogenesis model.

Value

returncell The text specifying the type of transition.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster https://code.google.com/p/lagrange/

Matzke_2012_IBS

ReeSmith2008

See Also

size_species_matrix, make_relprob_matrix_bi

Examples

1
testval=1

Example output

Loading required package: rexpokit
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.