# NOT RUN {
# We might think of re-writing the start of [lm] like so:
LM <- function(formula, data, subset, weights, na.action, method = "qr",
model = TRUE, x = FALSE, y = FALSE, qr = TRUE, singular.ok = TRUE,
contrasts = NULL, offset, ...) {
cl <- get_call()
mf <- do(model.frame,
arg_list(formula, data, subset, weights, na.action, offset))
z <- get.call()
class(z) <- c("LM", class(z))
z$call <- cl
z
}
# and `update` like so:
update.LM <- function(object, formula., ...) {
call <- object$call
extras <- dots(...)
call$formula <- forced_quo(update.formula(formula(object), formula.))
do(call)
}
# }
Run the code above in your browser using DataLab