lm_list | R Documentation |
build a list of lm models from group columns
lm_list(d, formula, ...)
d |
input long format data.frame w/grouping columns specified later |
formula |
lm formula to model each split |
... |
columns in d to split dataframe (unique groups) |
mpg_cyl_mdls <- lm_list(mtcars, mpg~cyl, "gear", "am")
mpg_cyl_mdls <- lm_list(mtcars, mpg~cyl, c("gear", "am")) # same as above
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.