diff --git a/DESCRIPTION b/DESCRIPTION index 8c598111..5194a7c1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,7 +9,7 @@ Description: Create beautiful and customizable tables to summarize several RTF, JPG, or PNG. Tables can easily be embedded in 'Rmarkdown' or 'knitr' dynamic documents. Details can be found in Arel-Bundock (2022) . -Version: 2.0.0.10 +Version: 2.0.0.11 Authors@R: c(person("Vincent", "Arel-Bundock", email = "vincent.arel-bundock@umontreal.ca", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 515bff92..2d01a994 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,10 @@ New features: * `formula` can now include variables on the left-hand side to indicate the subset of columns to summarize: `datasummary_balance(mpg + hp ~ am, data = mtcars)` Thanks to @etiennebacher for feature request #751. +Minor: + +* Unnecessary text printed to screen on some F stat computations is now suppressed. + Bugs: * `escape` argument not respected in `datasummary_df()`. Thanks to @adamaltmejd for report #740 diff --git a/R/methods_stats.R b/R/methods_stats.R index 40a68b8c..ff0d5725 100644 --- a/R/methods_stats.R +++ b/R/methods_stats.R @@ -20,7 +20,9 @@ glance_custom_internal.lm <- function(x, vcov_type = NULL, gof = NULL, ...) { if (inherits(gof, "data.frame") && "statistic" %in% colnames(gof)) { out[["F"]] <- gof$statistic } else { - fstat <- try(lmtest::waldtest(x, vcov = stats::vcov)$F[2], silent = TRUE) + if (isTRUE(check_dependency("lmtest"))) { + void <- utils::capture.output(fstat <- try(lmtest::waldtest(x, vcov = stats::vcov)$F[2], silent = TRUE)) + } if (inherits(fstat, "numeric")) { out[["F"]] <- fstat }