<testonly>od <- options(digits = 4)</testonly>
myenv <- new.env()
assign("mean", 0., envir = myenv)
assign("sd", 1., envir = myenv)
assign("x", seq(-3., 3., len = 31), envir = myenv)
numericDeriv(quote(pnorm(x, mean, sd)), c("mean", "sd"), myenv)
<testonly>options(od)</testonly>
Run the code above in your browser using DataLab