Skip to content
Prev 27276 / 63424 Next

as.function()

The gsubfn package can do something like that too.  If you
preface a function with fn$ then it will interpret certain formula
arguments as functions.  If all we want is the function itself we
can use force, the identity function, to recover it:
function (x, y)
2 * x + 3 * y^2

If there are free variables in the formula that you don't want to
include in the argument list the left hand side can be used to
specify the argument list:
function (x, y)
2 * x + a * y^2
On Jan 14, 2008 1:05 PM, Tony Plate <tplate at acm.org> wrote: