To be released as 0.7.0
If you pass a dataset to
augment() via the
newdata arguments, you are now guaranteed that the augmented dataset will have exactly the same number of rows as the original dataset. This differs from previous behavior primarily when there are missing values. Previously
augment() would drop rows containing
NA. This should no longer be the case.
Similarly: augment no longer accepts an
na.action argument (TODO: figure out why this wasn’t in the function signature in the first place)
conf.intarguments now default to
conf.levelarguments now default to
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 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
Almost all tidiers should now return
tibbles rather than
data.frames. Deprecated tidying methods, Bayesian and mixed model tidiers still return
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:
This is because the default
data = model.frame(fit) cannot be coerced to
Another consequence of this is that
augment.coxph from the
survival package now require that the user explicitly passes data to either the
These restrictions will be relaxed in an upcoming release of
broom pending support for matrix-columns in tibbles.
Developers are likely to experience issues:
[, which returns a tibble rather than a vector.
roxygen2template based documentation system.
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:
alphaargument has been removed from
separate.levelsargument has been removed from
tidy.TukeyHSD. To obtain the effect of
separate.levels = TRUE, users may
tidyr::separateafter tidying. This is consistent with the
fe.errorargument was removed from
tidy.felm. When fixed effects are tidier, their standard errors are now always included.
tidy.disthas been renamed
arimaobjects fit with
method = "CSS"(#396 by @josue-rodriguez)
family = multinomial(#395 by @erleholgersen)
quantregintercept only models (#378 by @erleholgersen)
aovlistobjects (#377 by @mvevans89)
glmnetUtilsobjects (#352 by @Hong-Revo)
tidy_emmeansto handle column names with dashes (#351 by @bmannakee)
augment.felmno longer returns
augment.felm(#347 by @ShreyasSingh)
confint_tidynow drops rows of all
NA(#345 by @atyre2)
caret::confusionMatrixobjects (#344 by @mkuehn10)
Kendall::Kendallobjects (#343 by @cimentadaj)
car::durbinWatsonTestobjects (#341 by @mkuehn10)
glancethrows an informative error for
quantreg:rqmodels fit with multiple
tauvalues (#338 by @bfgray3)
tidy.glmnetgains the ability to retain zero-valued coefficients with a
return_zerosargument that defaults to
FALSE(#337 by @bfgray3)
tidy.manovanow retains a
Residualsrow (#334 by @jarvisc1)
MASS::polrordinal model objects (#332 by @larmarange)
car::Anova(#325 by @mariusbarth)
tseries::garchmodels (#323 by @wilsonfreitas)
psychpackage (#313 by @nutterb)
loopackages (#298 by @jgabry)
tidy.prcompwhen missing labels (#265 by @corybrunson)
pkgdownsite at https://broom.tidyverse.org/ (#260 by @jayhesselberth)
AER::ivregmodels (#247 by @hughjonesd)
lavaanpackage (#233 by @puterleat)
tidy.coxph(#220 by @larmarange)
augmentmethod for chi-squared tests (#138 by @larmarange)
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
glanceon NULLs now return an empty data frame
inflate()function in favor of
quick = TRUEto return terms as character rather than factor (thanks to #191 from Matteo Sostero)
ivregobjects from the AER package (thanks to #245 from David Hugh-Jones)
survdiffobjects from the survival package (thanks to #147 from Michał Bojanowski)
emmeansfrom the emmeans package (thanks to #252 from Matthew Kay)
speedglmfrom the speedglm package (thanks to #248 from David Hugh-Jones)
muhazobjects from the muhaz package (thanks to #251 from Andreas Bender)
stlobjects from stats (thanks to #165 from Aaron Jacobs)
ref.gridobjects from the lsmeans package
betaregobjects from the betareg package
glmRobobjects from the robust package
brmsobjects from the brms package (thanks to #149 from Paul Buerkner)
tidy.glmnetto filter out rows where estimate == 0.
rstanarmtidiers (thanks to #177 from Jonah Gabry)
termcolumn. Also added
separate.levelsargument, with option to separate
tidy.manovato use correct column name for test (previously, always
kde_tidiersto tidy kernel density estimates
orcutt_tidiersto tidy the results of
tidy.distto tidy the distance matrix output of
distfrom the stats package
lmodel2objects from the lmodel2 package
poLCAobjects from the poLCA package
Mclustobjects from the Mclust package
tidymethods for lists, including u, d, v lists from
svd, and x, y, z lists used by
tidy.biglm, to create a smaller and faster version of the output.
rowwise_df_tidiersto allow the original data to be saved as a list column, then provided as a column name to
augment. This required removing
augmentS3 signature. Also added
tidy.coeftestfor coeftest objects from the lmtest package.
tidy.lmto work with “mlm” (multiple linear model) objects (those with multiple response columns).
glancefor “biglm” and “bigglm” objects from the biglm package.
tidy.coxphwhen one-row matrices are returned
multinomobjects from the nnet package.
tidy.pairwise.htest, which now can handle cases where the grouping variable is numeric.
tidy.aovlistmethod. This added
stringrpackage to IMPORTS to trim whitespace from the beginning and end of the
stratumcolumns. This also required adjusting
tidy.aovso that it could handle strata that are missing p-values.
glance.lmto work with
aovobjects along with
glancefor matrix objects, with
tidy.matrixconverting a matrix to a data frame with rownames included, and
glance.matrixreturning the same result as
.residcolumns were matrices rather than vectors.
rlm(robust linear model) and
gam(generalized additive model) objects, including adjustments to “lm” tidiers in order to handle them. See
augment, particularly with regard to missing data and the
na.excludeargument, has through the use of the
augment_columnsfunction been made consistent across the following models:
tests/testthat/test-augment.Rwere added to ensure consistency across these models.
glance methods were added for
rowwise_df objects, and are set up to apply across their rows. This allows for simple patterns such as:
globals.Rto declare global variables.
This is the original version published on CRAN.
glancemethods for data.frames have also been added, and
augment.data.frameproduces an error (rather than returning the same data.frame).
stderrorhas been changed to
std.error(affects many functions) to be consistent with broom’s naming conventions for columns.
bootstraphas been added based on this example, to perform the common use case of bootstrapping models.