##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (object, fun, newdata = NULL, ...)
{
if (is.null(newdata) && !is.null(object$data))
newdata <- object$data
localf <- function(coef, ...) {
if ("coefficients" %in% names(object)) {
object$coefficients <- coef
} else if ("coef" %in% names(object)) {
object$coef <- coef
} else coef(object) <- coef
fun(object, ...)
}
numDeltaMethod(object, localf, newdata = newdata, ...)
}
Run the code above in your browser using DataLab