Turn a Character String of the Right-Hand Side of an Equation into an R Function
equation2function converts the right-hand side of an equation that can be written
as a single line (like the right-hand side of an object of class
creates an R function which calls the variables within as arguments and returns values
consistent with the parameters of the input equation as written.
The right-hand-side (RHS) of an equation, given as a character string.
If not of type character,
The environment the resulting function will be evaluated in.
A useless string used simply as a placeholder in turning
This simple little function is rather hacky but seems to get the job done, for a functionality that doesn't seem to be present elsewhere in R.
A function, with named blank (i.e. no default value) arguments.
David W. Bapst
1 2 3 4 5 6 7 8 9 10 11 12 13
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.