This routine takes a text string and a data frame or list. It first sees if the
string is the name of a variable in the data frame/ list. If it is then the value of this variable is returned.
Otherwise the routine tries to evaluate the expression within the data.frame/list (but nowhere else) and if
successful returns the result. If neither step works then
NULL is returned. The routine is useful for
processing gam formulae. If the variable is a matrix then it is coerced to a numeric vector, by default.
a text string which is either the name of a variable in
A data frame or list.
Should matrices be coerced to numeric vectors?
The evaluated variable or
NULL. May be coerced to a numeric vector if it's a matrix.
Simon N. Wood firstname.lastname@example.org
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.