model.apply | R Documentation |
this function allow users to apply any function
over models nested in tibbles as the output of the fitscales()
function. Users may use this function to retrieve model info,
as using summary, or apply their own personalized functions
over the models. The function will return a similar tibble
to the input table, but with an extra column with the result
of the function applied.
model.apply(fun, data, result_to = NULL)
fun |
vector. The name of a function to be applied. Any function that can handle model objects are allowed, specially tidy(), glance(), augment() from broom, broom.mixed and broomExtra packages. Custom functions are also allowed, but they have to be loaded in the environment space. |
data |
a tibble. An output from fitscales function |
result_to |
the new collumn name. It is optional. If null, the new collumn name will be 'model.'+fun |
This function was designed to help users expanding the possibility in handle data from model objects, specially for those not covered by broom API. The package broom.mixed can be used to handle mixed models. Users only need to install and library the package, so the functions tidy, glance, and augment will be also applied for packages like 'lme4' and others.
fitscales()
calc_lsm()
decouple()
nestedscales()
## Not run:
ls <- decouple(r,p,c(1000,2000,3000))
lsm <- calc_lsm(ls, c("pland","shdi"))
models <- fitscales(lsm, bio=euglossini, model="lm")
model.apply("summary",models, result_to="mod.summ")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.