Learn R Programming

BioGeoBEARS (version 0.2.1)

meval: eval() function for use in sapply

Description

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

Usage

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.

Value

outval The numeric result of eval.

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.

References

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

Matzke_2012_IBS

See Also

convolve

Examples

Run this code
testval=1
d = 0.1
equation_txt = "1*d+1*d"
meval(equation_txt)

Run the code above in your browser using DataLab