We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reported by Raimundo Neto on R-devel 2020-06-15.
Simple example that fails:
x <- 0 tryCatch(numericDeriv(quote(sqrt(-x)), "x"), error = identity) stopifnot(x == 0)
We save and restore the theta value but don't guard against a jump. We could put in a cleanup handler at the C level.
Cleaner is probably to push another frame with the variable to change on the environment. At the R level this can be done in numericDeriv by changing
val <- .Call(C_numeric_deriv, expr, theta, rho, dir)
to
rho1 <- new.env(parent = rho) assign(theta, get(theta, rho), rho1) val <- .Call(C_numeric_deriv, expr, theta, rho1, dir)
Might be better to make the analogous change at C level though as we document numeric_deriv in R-exts.texi.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reported by Raimundo Neto on R-devel 2020-06-15.
Simple example that fails:
We save and restore the theta value but don't guard against a jump.
We could put in a cleanup handler at the C level.
Cleaner is probably to push another frame with the variable to change
on the environment. At the R level this can be done in numericDeriv by
changing
to
Might be better to make the analogous change at C level though as we
document numeric_deriv in R-exts.texi.
METADATA
The text was updated successfully, but these errors were encountered: