This is a simple function to grab the slope coefficients of a linear model.

grab_coeffs(lm_obj)

Arguments

lm_obj

the linear model object created by the lm() function.

Examples

library(palmerpenguins) fit <- lm(bill_length_mm ~ ., data = penguins[, -8]) grab_coeffs(fit)
#> (Intercept) speciesChinstrap speciesGentoo islandDream #> 15.343290858 9.835501692 6.117675470 -0.503814879 #> islandTorgersen bill_depth_mm flipper_length_mm body_mass_g #> -0.127431335 0.300670205 0.069257070 0.001080668 #> sexmale #> 2.047858829