coef will extract the coefficients attribute from a function.
Functions created by applying link{makeFun} to a model produced
by lm(), glm(), or nls() store
the model coefficients there to enable this extraction.
# S3 method for class '`function`'
coef(object, ...)if (require(mosaicData)) {
model <- lm( width ~ length, data = KidsFeet)
f <- makeFun( model )
coef(f)
}
#> Loading required package: mosaicData
#> (Intercept) length
#> 2.8622761 0.2479478