This functions implements the update method for bestfit models.

# S3 method for bestfit
update(object, formula., ...)

Arguments

object

a bestfit object.

formula.

a generic formula.

...

further arguments to be added to the original call.

Value

a new bestfit object, update according to the arguments passed to update.bestfit.

Examples

dados <- centro_2015@data
#> Error in eval(expr, envir, enclos): trying to get slot "data" from an object (class "sf") that is not an S4 object
best_fit <- bestfit(valor ~ ., dados)
#> Error in as.data.frame(data): object 'dados' not found
s <- summary(best_fit)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'summary': object 'best_fit' not found
out <- car::outlierTest(s$fit)
#> Error in car::outlierTest(s$fit): object 's' not found
#update best_fit in order to exclude the outlier found (AP_31) outliers <- match(names(out$p), rownames(centro_2015@data))
#> Error in match(names(out$p), rownames(centro_2015@data)): object 'out' not found
update(best_fit, subset = -outliers)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'update': object 'best_fit' not found