Update a Fitted Model Object

DESCRIPTION:
Allows a new model to be created from an old model by providing only those arguments that need to be changed.

USAGE:
update(object, formula, ..., evaluate=T, class)

REQUIRED ARGUMENTS:
object:
any object with a component named call, which is the expression used to create itself.

OPTIONAL ARGUMENTS:
formula:
a modeling formula, such as y ~ a + b. A single dot . on either side of the ~ gets replaced by the left or right side of the formula in object. The dot on the left can be omitted. By default, it refits object using the same formula as in object.
...:
any other arguments that are appropriate for the particular call. These must all be named, and may be abbreviated, in the same manner they could be as arguments to the fitting function itself. Arguments in the previous fit; that is, in object$call, can be removed by putting nothing on the right side of the =. For example, the argument x=, in a call to update() causes the x argument, if present in object$call, to be removed.
evaluate:
if TRUE (the default), the new call is evaluated; otherwise, the call is returned as an unevaluated expression.
class:
the fitting class to be used for the new object; that is, the basic fitting function, such as lm(), aov(), glm(), etc. This argument allows the model to be switched from one kind to another, assuming the formula and other arguments make sense for the new model. Although suggestive, class is a slight misnomer since the object may already inherit from this new class.

VALUE:
either a new updated object, or else an unevaluated expression for creating such an object.

DETAILS:
update is a generic function, it currently has methods for formula and a default method.

SEE ALSO:
add1 , drop1 , Methods , formula.object .

EXAMPLES:
# refit, unchanged
update(glmob)
# refit, adding term
update(glmob, ~ . + Age)
# transform response to log scale; drop intercept
update(lmob, log(.) ~ . -1)
# use all the 2nd order interactions of previous fit
update(lmob,~ .^2)
#remove the model argument, supply a subset
update(gamob, mod=, subset = Age>25)