Convert Statistical Objects into Tidy Tibbles

Summarizes key information about statistical objects in tidy tibbles. This makes it easy to report results, create plots and consistently work with large numbers of models at once. Broom provides three verbs that each provide different types of information about a model. tidy() summarizes information about model components such as coefficients of a regression. glance() reports information about an entire model, such as goodness of fit measures like AIC and BIC. augment() adds information about individual observations to a dataset, such as fitted values or influence measures.


CRAN status Travis-CI Build Status AppVeyor Build Status Coverage Status


broom summarizes key information about models in tidy tibble()s. broom provides three verbs to make it convenient to interact with model objects:

  • tidy() summarizes information about model components
  • glance() reports information about the entire model
  • augment() adds informations about observations to a dataset

For a detailed introduction, please see vignette("broom").

broom tidies 100+ models from popular modelling packages and almost all of the model objects in the stats package that comes with base R. vignette("available-methods") lists method availabilty.

If you aren't familiar with tidy data structures and want to know how they can make your life easier, we highly recommend reading Hadley Wickham's Tidy Data.


# alternatively, to install just broom:
# to get the development version from GitHub:

If you find a bug, please file a minimal reproducible example in the issues.


tidy() produces a tibble() where each row contains information about an important component of the model. For regression models, this often corresponds to regression coefficients. This is can be useful if you want to inspect a model or create custom visualizations.

fit <- lm(Sepal.Width ~ Petal.Length + Petal.Width, iris)
#> # A tibble: 3 x 5
#>   term         estimate std.error statistic  p.value
#>   <chr>           <dbl>     <dbl>     <dbl>    <dbl>
#> 1 (Intercept)     3.59     0.0937     38.3  2.51e-78
#> 2 Petal.Length   -0.257    0.0669     -3.84 1.80e- 4
#> 3 Petal.Width     0.364    0.155       2.35 2.01e- 2

glance() returns a tibble with exactly one row of goodness of fitness measures and related statistics. This is useful to check for model misspecification and to compare many models.

#> # A tibble: 1 x 11
#>   r.squared adj.r.squared sigma statistic p.value    df logLik   AIC   BIC
#> *     <dbl>         <dbl> <dbl>     <dbl>   <dbl> <int>  <dbl> <dbl> <dbl>
#> 1     0.213         0.202 0.389      19.9 2.24e-8     3  -69.8  148.  160.
#> # ... with 2 more variables: deviance <dbl>, df.residual <int>

augment adds columns to a dataset, containing information such as fitted values, residuals or cluster assignments. All columns added to a dataset have . prefix to prevent existing columns from being overwritten.

augment(fit, data = iris)
#> # A tibble: 150 x 12
#>    Sepal.Length Sepal.Width Petal.Length Petal.Width Species .fitted
#>  *        <dbl>       <dbl>        <dbl>       <dbl> <fct>     <dbl>
#>  1          5.1         3.5          1.4         0.2 setosa     3.30
#>  2          4.9         3            1.4         0.2 setosa     3.30
#>  3          4.7         3.2          1.3         0.2 setosa     3.33
#>  4          4.6         3.1          1.5         0.2 setosa     3.27
#>  5          5           3.6          1.4         0.2 setosa     3.30
#>  6          5.4         3.9          1.7         0.4 setosa     3.30
#>  7          4.6         3.4          1.4         0.3 setosa     3.34
#>  8          5           3.4          1.5         0.2 setosa     3.27
#>  9          4.4         2.9          1.4         0.2 setosa     3.30
#> 10          4.9         3.1          1.5         0.1 setosa     3.24
#> # ... with 140 more rows, and 6 more variables: <dbl>,
#> #   .resid <dbl>, .hat <dbl>, .sigma <dbl>, .cooksd <dbl>,
#> #   .std.resid <dbl>


We welcome contributions of all types!

If you have never made a pull request to an R package before, broom is an excellent place to start. Find an issue with the Beginner Friendly tag and comment that you'd like to take it on and we'll help you get started.

We encourage typo corrections, bug reports, bug fixes and feature requests. Feedback on the clarity of the documentation is especially valuable.

If you are interested in adding new tidiers methods to broom, please read vignette("adding-tidiers").

We have a Contributor Code of Conduct. By participating in broom you agree to abide by its terms.


broom 0.5.1

  • tidy(), glance() and augment() are now re-exported from the generics package.

broom 0.5.0

Tidiers now return tibble::tibble()s. This release also includes several new tidiers, new vignettes and a large number of bugfixes. We've also begun to more rigorously define tidier specifications: we've laid part of the groundwork for stricter and more consistent tidying, but the new tidier specifications are not yet complete. These will appear in the next release.

Additionally, users should note that we are in the process of migrating tidying methods for mixed models and Bayesian models to broom.mixed. broom.mixed is not on CRAN yet, but all mixed model and Bayesian tidiers will be deprecated once broom.mixed is on CRAN. No further development of mixed model tidiers will take place in broom.

Breaking changes

Almost all tidiers should now return tibbles rather than data.frames. Deprecated tidying methods, Bayesian and mixed model tidiers still return data.frames.

Users are mostly to experience issues when using augment in situations where tibbles are stricter than data frames. For example, specifying model covariates as a matrix object will now error:

fit <- rq(stack.loss ~ stack.x, tau = .5)
#> Error: Column `stack.x` must be a 1d atomic vector or a list

This is because the default data argument data = model.frame(fit) cannot be coerced to tibble.

Another consequence of this is that augment.survreg and augment.coxph from the survival package now require that the user explicitly passes data to either the data or newdata arguments.

These restrictions will be relaxed in an upcoming release of broom pending support for matrix-columns in tibbles.

Developers are likely to experience issues:

  • subsetting tibbles with [, which returns a tibble rather than a vector.
  • setting rownames on tibbles, which is deprecated.
  • using matrix and vector tidiers, now deprecated.
  • handling the additional tibble classes tbl_df and tbl beyond the data.frame class
  • linking to defunct documentation files -- broom recently moved all tidiers to a roxygen2 template based documentation system.

New vignettes

This version of broom includes several new vignettes:

  • vignette("available-methods", package = "broom") contains a table detailing which tidying methods are available
  • vignette("adding-tidiers", package = "broom") is an in-progress guide for contributors on how to add new tidiers to broom
  • vignette("glossary", package = "broom") contains tables describing acceptable argument names and column names for the in-progress new specification.

Several old vignettes have also been updated:

  • vignette("bootstrapping", package = "broom") now relies on the rsample package and a tidyr::nest-purrr::map-tidyr::unnest workflow. This is now the recommended workflow for working with multiple models, as opposed to the old dplyr::rowwise-dplyr::do based workflow.


  • Matrix and vector tidiers have been deprecated in favor of tibble::as_tibble and tibble::enframe
  • Dataframe tidiers and rowwise dataframe tidiers have been deprecated
  • bootstrap() has been deprecated in favor of the rsample
  • inflate has been removed from broom

Other changes

  • The alpha argument has been removed from quantreg tidy methods
  • The separate.levels argument has been removed from tidy.TukeyHSD. To obtain the effect of separate.levels = TRUE, users may tidyr::separate after tidying. This is consistent with the multcomp tidier behavior.
  • The fe.error argument was removed from tidy.felm. When fixed effects are tidier, their standard errors are now always included.
  • The diag argument in tidy.dist has been renamed diagonal
  • Advice to help beginners make PRs (#397 by @karldw)
  • glance support for arima objects fit with method = "CSS" (#396 by @josue-rodriguez)
  • A bug fix to re-enable tidying glmnet objects with family = multinomial (#395 by @erleholgersen)
  • A bug fix to allow tidying quantreg intercept only models (#378 by @erleholgersen)
  • A bug fix for aovlist objects (#377 by @mvevans89)
  • Support for glmnetUtils objects (#352 by @Hong-Revo)
  • A bug fix to allow tidy_emmeans to handle column names with dashes (#351 by @bmannakee)
  • augment.felm no longer returns .fe_ and .comp columns
  • Support saved formulas in augment.felm (#347 by @ShreyasSingh)
  • confint_tidy now drops rows of all NA (#345 by @atyre2)
  • A new tidier for caret::confusionMatrix objects (#344 by @mkuehn10)
  • Tidiers for Kendall::Kendall objects (#343 by @cimentadaj)
  • A new tidying method for car::durbinWatsonTest objects (#341 by @mkuehn10)
  • glance throws an informative error for quantreg:rq models fit with multiple tau values (#338 by @bfgray3)
  • tidy.glmnet gains the ability to retain zero-valued coefficients with a return_zeros argument that defaults to FALSE (#337 by @bfgray3)
  • tidy.manova now retains a Residuals row (#334 by @jarvisc1)
  • Tidiers for ordinal::clm, ordinal::clmm, survey::svyolr and MASS::polr ordinal model objects (#332 by @larmarange)
  • Support for anova objects from car::Anova (#325 by @mariusbarth)
  • Tidiers for tseries::garch models (#323 by @wilsonfreitas)
  • Removed dependency on psych package (#313 by @nutterb)
  • Improved error messages (#303 by @michaelweylandt)
  • Compatibility with new rstanarm and loo packages (#298 by @jgabry)
  • Support for tidying lists return by irlba::irlba
  • A truly huge increase in unit tests (#267 by @dchiu911)
  • Bug fix for tidy.prcomp when missing labels (#265 by @corybrunson)
  • Added a pkgdown site at (#260 by @jayhesselberth)
  • Added tidiers for AER::ivreg models (#247 by @hughjonesd)
  • Added tidiers for the lavaan package (#233 by @puterleat)
  • Added argument to tidy.coxph (#220 by @larmarange)
  • Added augment method for chi-squared tests (#138 by @larmarange)
  • Many small improvements throughout


Many many thanks to all the following for their thoughtful comments on design, bug reports and PRs! The community of broom contributors has been kind, supportive and insighftul and I look forward to working you all again!

@atyre2, @batpigandme, @bfgray3, @bmannakee, @briatte, @cawoodjm, @cimentadaj, @dan87134, @dgrtwo, @dmenne, @ekatko1, @ellessenne, @erleholgersen, @Hong-Revo, @huftis, @IndrajeetPatil, @jacob-long, @jarvisc1, @jenzopr, @jgabry, @jimhester, @josue-rodriguez, @karldw, @kfeilich, @larmarange, @lboller, @mariusbarth, @michaelweylandt, @mine-cetinkaya-rundel, @mkuehn10, @mvevans89, @nutterb, @ShreyasSingh, @stephlocke, @strengejacke, @topepo, @willbowditch, @WillemSleegers, and @wilsonfreitas

broom 0.4.4

  • Fixed gam tidiers to work with "Gam" objects, due to an update in gam 1.15. This fixes failing CRAN tests
  • Improved test coverage (thanks to #267 from Derek Chiu)

broom 0.4.3

  • Changed the deprecated dplyr::failwith to purrr::possibly
  • augment and glance on NULLs now return an empty data frame
  • Deprecated the inflate() function in favor of tidyr::crossing
  • Fixed confidence intervals in the gmm tidier (thanks to #242 from David Hugh-Jones)
  • Fixed a bug in bootstrap tidiers (thanks to #167 from Jeremy Biesanz)
  • Fixed tidy.lm with quick = TRUE to return terms as character rather than factor (thanks to #191 from Matteo Sostero)
  • Added tidiers for ivreg objects from the AER package (thanks to #245 from David Hugh-Jones)
  • Added tidiers for survdiff objects from the survival package (thanks to #147 from Michał Bojanowski)
  • Added tidiers for emmeans from the emmeans package (thanks to #252 from Matthew Kay)
  • Added tidiers for speedlm and speedglm from the speedglm package (thanks to #248 from David Hugh-Jones)
  • Added tidiers for muhaz objects from the muhaz package (thanks to #251 from Andreas Bender)
  • Added tidiers for decompose and stl objects from stats (thanks to #165 from Aaron Jacobs)

broom 0.4.2

  • Added tidiers for lsmobj and ref.grid objects from the lsmeans package
  • Added tidiers for betareg objects from the betareg package
  • Added tidiers for lmRob and glmRob objects from the robust package
  • Added tidiers for brms objects from the brms package (thanks to #149 from Paul Buerkner)
  • Fixed tidiers for orcutt 2.0
  • Changed tidy.glmnet to filter out rows where estimate == 0.
  • Updates to rstanarm tidiers (thanks to #177 from Jonah Gabry)
  • Fixed issue with survival package 2.40-1 (thanks to #180 from Marcus Walz)

broom 0.4.1

  • Added AppVeyor,, and code of conduct
  • Changed name of "NA's" column in summaryDefault output to "na"
  • Fixed tidy.TukeyHSD to include term column. Also added separate.levels argument, with option to separate comparison into level1 and level2
  • Fixed tidy.manova to use correct column name for test (previously, always pillai)
  • Added kde_tidiers to tidy kernel density estimates
  • Added orcutt_tidiers to tidy the results of cochrane.orcutt orcutt package
  • Added tidy.dist to tidy the distance matrix output of dist from the stats package
  • Added tidy and glance for lmodel2 objects from the lmodel2 package
  • Added tidiers for poLCA objects from the poLCA package
  • Added tidiers for sparse matrices from the Matrix package
  • Added tidiers for prcomp objects
  • Added tidiers for Mclust objects from the Mclust package
  • Added tidiers for acf objects
  • Fixed to be compatible with dplyr 0.5, which is being submitted to CRAN

broom 0.4.0

  • Added tidiers for geeglm, nlrq, roc, boot, bgterm, kappa, binWidth, binDesign, rcorr, stanfit, rjags, gamlss, and mle2 objects.
  • Added tidy methods for lists, including u, d, v lists from svd, and x, y, z lists used by image and persp
  • Added quick argument to tidy.lm, tidy.nls, and tidy.biglm, to create a smaller and faster version of the output.
  • Changed rowwise_df_tidiers to allow the original data to be saved as a list column, then provided as a column name to augment. This required removing data from the augment S3 signature. Also added tests-rowwise.R
  • Fixed various issues in ANOVA output
  • Fixed various issues in lme4 output
  • Fixed issues in tests caused by dev version of ggplot2

broom 0.3.7

  • Added tidiers for "plm" (panel linear model) objects from the plm package.
  • Added tidy.coeftest for coeftest objects from the lmtest package.
  • Set up tidy.lm to work with "mlm" (multiple linear model) objects (those with multiple response columns).
  • Added tidy and glance for "biglm" and "bigglm" objects from the biglm package.
  • Fixed bug in tidy.coxph when one-row matrices are returned
  • Added tidy.power.htest
  • Added tidy and glance for summaryDefault objects
  • Added tidiers for "lme" (linear mixed effects models) from the nlme package
  • Added tidy and glance for multinom objects from the nnet package.

broom 0.3.6

  • Fixed bug in tidy.pairwise.htest, which now can handle cases where the grouping variable is numeric.
  • Added tidy.aovlist method. This added stringr package to IMPORTS to trim whitespace from the beginning and end of the term and stratum columns. This also required adjusting tidy.aov so that it could handle strata that are missing p-values.
  • Set up glance.lm to work with aov objects along with lm objects.
  • Added tidy and glance for matrix objects, with tidy.matrix converting a matrix to a data frame with rownames included, and glance.matrix returning the same result as
  • Changed DESCRIPTION [email protected] to new format

broom 0.3.5

  • Fixed small bug in felm where the .fitted and .resid columns were matrices rather than vectors.
  • Added tidiers for rlm (robust linear model) and gam (generalized additive model) objects, including adjustments to "lm" tidiers in order to handle them. See ?rlm_tidiers and ?gam_tidiers for more.
  • Removed rownames from output

broom 0.3.4

  • The behavior of augment, particularly with regard to missing data and the na.exclude argument, has through the use of the augment_columns function been made consistent across the following models:

    • lm
    • glm
    • nls
    • merMod (lme4)
    • survreg (survival)
    • coxph (survival)

    Unit tests in tests/testthat/test-augment.R were added to ensure consistency across these models.

  • tidy, augment and glance methods were added for rowwise_df objects, and are set up to apply across their rows. This allows for simple patterns such as:

      regressions <- mtcars %>% group_by(cyl) %>% do(mod = lm(mpg ~ wt, .))
      regressions %>% tidy(mod)
      regressions %>% augment(mod)

    See ?rowwise_df_tidiers for more.

  • Added tidy and glance methods for Arima objects, and tidy for pairwise.htest objects.

  • Fixes for CRAN: change package description to title case, removed NOTES, mostly by adding globals.R to declare global variables.

  • This is the original version published on CRAN.

broom 0.3

  • Tidiers have been added for S3 objects from the following packages:
    • lme4
    • glmnet
    • survival
    • zoo
    • felm
    • MASS (ridgelm objects)
  • tidy and glance methods for data.frames have also been added, and produces an error (rather than returning the same data.frame).
  • stderror has been changed to std.error (affects many functions) to be consistent with broom's naming conventions for columns.
  • A function bootstrap has been added based on this example, to perform the common use case of bootstrapping models.

broom 0.2

  • Added "augment" S3 generic and various implementations. "augment" does something different from tidy: it adds columns to the original dataset, including predictions, residuals, or cluster assignments. This was originally described as "fortify" in ggplot2.
  • Added "glance" S3 generic and various implementations. "glance" produces a one-row data frame summary, which is necessary for tidy outputs with values like R^2 or F-statistics.
  • Re-wrote intro broom vignette/README to introduce all three methods.
  • Wrote a new kmeans vignette.
  • Added tidying methods for multcomp, sp, and map objects (from fortify-multcomp, fortify-sp, and fortify-map from ggplot2).
  • Because this integrates substantial amounts of ggplot2 code (with permission), added Hadley Wickham as an author in DESCRIPTION.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.7.0 by Alex Hayes, 2 months ago,

Report a bug at

Browse source code at

Authors: David Robinson [aut] , Alex Hayes [aut, cre] , Simon Couch [aut] , Indrajeet Patil [ctb] , Derek Chiu [ctb] , Matthieu Gomez [ctb] , Boris Demeshev [ctb] , Dieter Menne [ctb] , Benjamin Nutter [ctb] , Luke Johnston [ctb] , Ben Bolker [ctb] , Francois Briatte [ctb] , Jeffrey Arnold [ctb] , Jonah Gabry [ctb] , Luciano Selzer [ctb] , Gavin Simpson [ctb] , Jens Preussner [ctb] , Jay Hesselberth [ctb] , Hadley Wickham [ctb] , Matthew Lincoln [ctb] , Alessandro Gasparini [ctb] , Lukasz Komsta [ctb] , Frederick Novometsky [ctb] , Wilson Freitas [ctb] , Michelle Evans [ctb] , Jason Cory Brunson [ctb] , Simon Jackson [ctb] , Ben Whalley [ctb] , Karissa Whiting [ctb] , Yves Rosseel [ctb] , Michael Kuehn [ctb] , Jorge Cimentada [ctb] , Erle Holgersen [ctb] , Karl Dunkle Werner [ctb] , Ethan Christensen [ctb] , Steven Pav [ctb] , Paul PJ [ctb] , Ben Schneider [ctb] , Patrick Kennedy [ctb] , Lily Medina [ctb] , Brian Fannin [ctb] , Jason Muhlenkamp [ctb] , Matt Lehman [ctb] , Bill Denney [ctb] , Nic Crane [ctb] , Andrew Bates [ctb] , Vincent Arel-Bundock [ctb] , Hideaki Hayashi [ctb] , Luis Tobalina [ctb] , Annie Wang [ctb] , Wei Yang Tham [ctb] , Clara Wang [ctb] , Abby Smith [ctb] , Jasper Cooper [ctb] , E Auden Krauska [ctb] , Alex Wang [ctb] , Malcolm Barrett [ctb] , Charles Gray [ctb] , Jared Wilber [ctb] , Vilmantas Gegzna [ctb] , Eduard Szoecs [ctb] , Frederik Aust [ctb] , Angus Moore [ctb] , Nick Williams [ctb] , Marius Barth [ctb] , Bruna Wundervald [ctb] , Joyce Cahoon [ctb] , Grant McDermott [ctb] , Kevin Zarca [ctb] , Shiro Kuriwaki [ctb] , Lukas Wallrich [ctb] , James Martherus [ctb] , Chuliang Xiao [ctb] , Joseph Larmarange [ctb] , Max Kuhn [ctb] , Michal Bojanowski [ctb] , Hakon Malmedal [ctb] , Clara Wang [ctb] , Sergio Oller [ctb] , Luke Sonnet [ctb] , Jim Hester [ctb] , Cory Brunson [ctb] , Ben Schneider [ctb] , Bernie Gray [ctb] , Mara Averick [ctb] , Aaron Jacobs [ctb] , Andreas Bender [ctb] , Sven Templer [ctb] , Paul-Christian Buerkner [ctb] , Matthew Kay [ctb] , Erwan Le Pennec [ctb] , Johan Junkka [ctb] , Hao Zhu [ctb] , Benjamin Soltoff [ctb] , Zoe Wilkinson Saldana [ctb] , Tyler Littlefield [ctb] , Charles T. Gray [ctb] , Shabbh E. Banks [ctb] , Serina Robinson [ctb] , Roger Bivand [ctb] , Riinu Ots [ctb] , Nicholas Williams [ctb] , Nina Jakobsen [ctb] , Michael Weylandt [ctb] , Lisa Lendway [ctb] , Karl Hailperin [ctb] , Josue Rodriguez [ctb] , Jenny Bryan [ctb] , Chris Jarvis [ctb] , Greg Macfarlane [ctb] , Brian Mannakee [ctb] , Drew Tyre [ctb] , Shreyas Singh [ctb] , Laurens Geffert [ctb] , Hong Ooi [ctb] , Henrik Bengtsson [ctb] , Eduard Szocs [ctb] , David Hugh-Jones [ctb] , Matthieu Stigler [ctb]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports backports, dplyr, ellipsis, generics, glue, methods, purrr, rlang, stringr, tibble, tidyr

Suggests AER, akima, AUC, bbmle, betareg, biglm, binGroup, boot, btergm, car, caret, cluster, coda, covr, drc, e1071, emmeans, epiR, ergm, fixest, gam, gamlss,, gamlss.dist, gee, geepack, ggplot2, glmnet, glmnetUtils, gmm, Hmisc, irlba, joineRML, Kendall, knitr, ks, Lahman, lavaan, leaps, lfe, lm.beta, lme4, lmodel2, lmtest, lsmeans, maps, maptools, MASS, Matrix, mclogit, mclust, mediation, metafor, mfx, mgcv, modeldata, modeltests, muhaz, multcomp, network, nnet, orcutt, ordinal, plm, poLCA, psych, quantreg, rgeos, rmarkdown, robust, robustbase, rsample, sandwich, sp, spdep, spatialreg, speedglm, spelling, statnet.common, survey, survival, systemfit, testthat, tseries, zoo

Imported by CGPfunctions, DeLorean, ERSA, JSmediation, MatchThem, NetworkExtinction, PHEindicatormethods, R2MLwiN, RCT, RKorAPClient, SWMPrExtension, SimplifyStats, StroupGLMM, TSS.RESTREND, allestimates, amt, apaTables, autocogs, breathtestcore, broom.helpers, broom.mixed, broomExtra, card, catenary, catfun, cdom, chest, conjoint, convergEU, cvms, depigner, describedata, disto, doBy, docdescriptR, docinfeR, dotwhisker, dragon, echarts4r, edwards97, eoffice, equatiomatic, eurostat, explore, finalfit, forestmangr, forestmodel, funneljoin, gWQS, geepack, germinationmetrics, ggpmisc, glmmfields, gtsummary, highcharter, konfound, lcsm, lin.eval, mason, mice, modelr, modelsummary, moderndive, mosaic, mudfold, omicwas, pixiedust, psychReport,, radiant.model, robomit, rstatix, sclr, simglm, simts, sjstats, skedastic, specr, statsr, survminer, sweep, tadaatoolbox, takos, temperatureresponse, tidyMicro, tidycomm, tidymodels, tidyverse, tipr, valr, widyr.

Depended on by lineqGPR, nlshelper.

Suggested by DLMtool, DeclareDesign, GGally, KMunicate, MARSS, RBesT, agridat, arsenal, autoimage, bayestestR, casen, confoundr, crawl, crossmap, disk.frame, dplyr, eechidna, ethnobotanyR, faux, fhidata, fivethirtyeight, flextable, ggasym, ggdist, ggformula, glmmTMB, gravity, groupdata2, huxtable, infer, interactions, jtools, kayadata, lspline, lucid, macleish, miceFast, nls.multstart, openintro, plotly, pubh, qgcomp, rsample, simTool, simhelpers, sparklyr, texreg, tibbletime, tidybayes, tidycat, tidyquant, tidytext, timetk, utile.visuals.

See at CRAN