rpruim/mosaic — Issue #29: Odd result from makeFunction()
Author: dtkaplan
Created: 2012-02-04 20:12:24+00:00
State: open

makeFunction() isn't dealing very well with extraneous arguments. Example:

> makeFunction(sin(a*x^2)~x&a,a=3,y=4)
function (x, a = 3, x = 4)
sin(a * x^2)

The y=4 argument is re-assigning a value for x. Or, similarly here:

> makeFunction(sin(a*x^2)~x&a,a=3,y=4,z=8)
function (x, a = 3, x = 4, a = 8)
sin(a * x^2)

I suspect we should discard components from the ... input to makeFunction that don't show up in the all.vars() of the formula.