myf <- makeFun(sqrt(y * pnorm(1 + x^2, mean=2, sd=y)) ~ x & y, y=3)
dx_myf <- D(myf(x, y) ~ x)
dx_myf
But this works:
dx_myf <- D(myf(x, y) ~ x, y=3)
dx_myf
You need to carry over the default values from the original function and impose them on the derivative, unless overridden by a default assigned in the call to D().
But this works:
You need to carry over the default values from the original function and impose them on the derivative, unless overridden by a default assigned in the call to D().