update.asreml | R Documentation

## Update and Re-fit an Asreml Model

### Description

`update` extracts the call from the fitted object and evaluates that call, replacing any arguments with changed values. In particular, `G.param` and `R.param` are automatically replaced with those stored in the object.

### Usage

    update.asreml(object, fixed., random., sparse., rcov., ...,
                  evaluate = TRUE)

### Arguments

`object` | a valid `asreml` object with a component named `call`, the expression used to create itself.
`fixed.` | changes to the fixed formula. This is a two sided formula where `"."` is substituted for existing components in the `fixed` component of `object$call`.
`random.` | changes to the random formula. This is a one sided formula where `"."` is substituted for existing components in the right hand side of the `random` component of `object$call`.
`sparse.` | changes to the sparse formula. This is a one sided formula where `"."` is substituted for existing components in the right hand side of the `sparse` component of `object$call`.
`rcov.` | changes to the error formula. This is a one sided formula where `"."` is substituted for existing components in the right hand side of the `rcov` component of `object$call`.
`...` | additional arguments to the call, or arguments with changed values.
`evaluate` | if TRUE (the default) the new call is evaluated; otherwise the call is returned as an unevaluated expression.

### Details

In addition to any other changes, `update.asreml` replaces the arguments `R.param` and `G.param` with `object\$R.param` and `object\$G.param`, respectively, creating a new fitted object using the values from a previous model as starting values.

### Value

either a new updated `asreml` object, or else an unevaluated expression for creating such an object.

### Warning

If a call to `asreml.control` exists as the value of the `control` argument in `object$call`, the `control` argument (and consequently the call to `asreml.control`) must be given in full in the call to `update.asreml` if existing arguments to `asreml.control` are to be changed or new ones added.

### Author(s)

David Butler

### See Also

`asreml`

### Examples

    data(oats, package="asreml3")
    oats.asr <- asreml(yield ~ Variety+Nitrogen,
                       random = ~ Blocks/Wplots, data=oats)
    oats2.asr <- update(oats.asr, fixed = . ~ . + Variety:Nitrogen)