Return a variable importance plot and coefficient plot from a linear model. Used to easily visualize the contributions of explanatory variables in a supervised model

auto_variable_contributions(data, formula, scale = TRUE)

Arguments

data

dataframe

formula

formula

scale

logical. If FALSE puts coefficients on original scale

Value

a ggplot object

Examples


iris %>%
framecleaner::create_dummies() %>%
auto_variable_contributions(
 tidy_formula(., target = Petal.Width)
 )
#> 1 column(s) have become 3 dummy columns
#> Loading required namespace: broom.mixed



iris %>%
auto_variable_contributions(
tidy_formula(., target = Species)
)