symbolic_cell_to_relprob_cell: Convert symbolic cell (a text equation) to relprob matrix (a...

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

View source: R/BioGeoBEARS_basics_v1.R

Description

This is a utility function for symbolic_to_P_matrix and symbolic_to_Q_matrix.

Usage

1
2
  symbolic_cell_to_relprob_cell(charcell, cellsplit = "",
    mergesym = "*", d = 0.1, e = 0.01, ...)

Arguments

charcell

The text formula.

cellsplit

The symbol to split the formulas on. Default "\\+" (plus symbol, with escape code).

mergesym

The symbol to merge the formulas with. Default "+".

d

The dispersal/range expansion rate. Default d=0.1.

e

The extinction/range contraction rate. Default e=0.01.

...

Additional arguments to pass to strsplit.

Details

This function can be used in sapply. It still will not be very fast compared to the calculations in cladoRcpp, but can be useful for demonstrative purposes.

Value

cellval The output cell value.

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

symbolic_to_P_matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
testval=1

charcell = "1*d+1*d"

# Right
cellval = symbolic_cell_to_relprob_cell(charcell, cellsplit="yadda",
mergesym="", d=0.1, e=0.01)
cellval

# Wrong
cellval = symbolic_cell_to_relprob_cell(charcell, cellsplit="\\+",
mergesym="*", d=0.1, e=0.01)
cellval

# Right
cellval = symbolic_cell_to_relprob_cell(charcell, cellsplit="\\+",
mergesym="+", d=0.1, e=0.01)
cellval

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