purrroom: purrroom

Description Usage Arguments Value Examples

Description

purrroom easily integrates purrr::map modeling into broom. Providing the user with a single tidy dataframe for all models.

Usage

1
purrroom(mapData, broomCall = function(.) {     tidy(.) })

Arguments

mapData

a purrr call that ends with a mapped model call

broomCall

a broom call (e.g. glance(), tidy()) call wrapped in a function with a dot argument

Value

Tidy data.frame containing all split model summaries.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
mapDat <-
mtcars %>%
  split(.$cyl) %>%
  map(~ lm(mpg ~ wt, data = .))
## As a function call:
broomCall <- function(.) {tidy(., conf.int=T)}
purrroom(mapDat, broomCall)
## Using piping:
mtcars %>%
  split(.$cyl) %>%
  map(~ lm(mpg ~ wt, data = .)) %>%
  purrroom()

TaylorAndrew/atPostAnalyze documentation built on May 9, 2019, 4:23 p.m.