Apply both broom::tidy() and broom::glance() to an object and return a single tibble with both sets of information.

tidy_glance(x, ..., tidy_args = list(), glance_args = list())

Arguments

x

An object to be converted into a tidy tibble.

...

Additional arguments passed to broom::tidy() and broom::glance().

Arguments are passed to both methods, but should be ignored by the inapplicable method. For example, if called on a lm object, conf.int will affect broom::tidy() but not broom::glance().

tidy_args

A list of additional arguments passed only to broom::tidy().

glance_args

A list of additional arguments passed only to broom::glance().

Value

A tibble with columns and rows from broom::tidy() and columns of repeated rows from broom::glance().

Column names that appear in both the tidy data and glance data will be disambiguated by appending "model." to the glance column names.

Examples

mod <- lm(mpg ~ wt + qsec, data = mtcars) tidy_glance(mod)
#> # A tibble: 3 x 17 #> term estimate std.error statistic p.value r.squared adj.r.squared sigma #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 (Intercep… 19.7 5.25 3.76 7.65e- 4 0.826 0.814 2.60 #> 2 wt -5.05 0.484 -10.4 2.52e-11 0.826 0.814 2.60 #> 3 qsec 0.929 0.265 3.51 1.50e- 3 0.826 0.814 2.60 #> # … with 9 more variables: model.statistic <dbl>, model.p.value <dbl>, #> # df <dbl>, logLik <dbl>, AIC <dbl>, BIC <dbl>, deviance <dbl>, #> # df.residual <int>, nobs <int>
tidy_glance(mod, conf.int = TRUE)
#> # A tibble: 3 x 19 #> term estimate std.error statistic p.value conf.low conf.high r.squared #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 (Intercept) 19.7 5.25 3.76 7.65e- 4 9.00 30.5 0.826 #> 2 wt -5.05 0.484 -10.4 2.52e-11 -6.04 -4.06 0.826 #> 3 qsec 0.929 0.265 3.51 1.50e- 3 0.387 1.47 0.826 #> # … with 11 more variables: adj.r.squared <dbl>, sigma <dbl>, #> # model.statistic <dbl>, model.p.value <dbl>, df <dbl>, logLik <dbl>, #> # AIC <dbl>, BIC <dbl>, deviance <dbl>, df.residual <int>, nobs <int>
tidy_glance(mod, tidy_args = list(conf.int = TRUE))
#> # A tibble: 3 x 19 #> term estimate std.error statistic p.value conf.low conf.high r.squared #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 (Intercept) 19.7 5.25 3.76 7.65e- 4 9.00 30.5 0.826 #> 2 wt -5.05 0.484 -10.4 2.52e-11 -6.04 -4.06 0.826 #> 3 qsec 0.929 0.265 3.51 1.50e- 3 0.387 1.47 0.826 #> # … with 11 more variables: adj.r.squared <dbl>, sigma <dbl>, #> # model.statistic <dbl>, model.p.value <dbl>, df <dbl>, logLik <dbl>, #> # AIC <dbl>, BIC <dbl>, deviance <dbl>, df.residual <int>, nobs <int>