meval: 'eval()' function for use in 'sapply'

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

View source: R/BioGeoBEARS_basics_v1.R

Description

meval is a wrapper for eval, to allow use in sapply.

Usage

1
  meval(equation_txt)

Arguments

equation_txt

The text of the equation to run eval on – e.g., from a cell of a text-based transition matrix.

Details

This is an attempt to speed up the use of eval; in general use of eval to convert a text version of a transition matrix to a numeric version with probabilities is a poor, slow choice; but it can be useful for examples and display purposes.

See cladoRcpp for fast C++ implementations of transition matrix setup.

Value

outval The numeric result of eval.

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

convolve

Examples

1
2
3
4
testval=1
d = 0.1
equation_txt = "1*d+1*d"
meval(equation_txt)

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