get_tidyFit | R Documentation |
Returns a single tidyFit object from a tidyfit.models frame based on a given row number.
get_tidyFit(df, ..., .first_row = TRUE)
df |
a tidyfit.models frame created using m(), regress(), classify() and similar methods |
... |
arguments passed to |
.first_row |
should the first row be returned if the (filtered) df contains multiple rows |
This method is a utility to return the tidyFit object from a row index of the tidyfit.models frame. The tidyFit object contains the fitted model and several additional objects necessary to reproduce the analysis or refit the model on new data.
An object of the class associated with the underlying fitting algorithm
Johann Pfitzinger
get_model
method
# Load data
data("mtcars")
# fit separate models for transmission types
mtcars <- dplyr::group_by(mtcars, am)
fit <- regress(mtcars, mpg ~ ., m("lm"))
# get the model for single row
get_tidyFit(fit, am == 0)
# get model by row number
get_tidyFit(fit, dplyr::row_number() == 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.