From a56bbf568b1c981db9e38f7d7a345f84945bea54 Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 18 May 2024 12:58:54 -0400 Subject: [PATCH 1/7] bump --- DESCRIPTION | 8 ++++---- NEWS.md | 9 +++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5f0b9add..3990beb4 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.13 +Version: 2.1.0 Authors@R: c(person("Vincent", "Arel-Bundock", email = "vincent.arel-bundock@umontreal.ca", role = c("aut", "cre"), @@ -53,10 +53,10 @@ Imports: data.table (>= 1.15.2), generics, glue, - insight (>= 0.19.9), + insight (>= 0.19.11), methods, - parameters (>= 0.21.6), - performance (>= 0.10.9), + parameters (>= 0.21.7), + performance (>= 0.11.0), tables (>= 0.9.17), tinytable (>= 0.3.0) Suggests: diff --git a/NEWS.md b/NEWS.md index 2e4c0356..7df5ec96 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,18 +1,15 @@ # News -## Development +## 2.1.0 -New features: +New: * `modelsummary()` gets a `gof_function` argument which accepts functions to extract custom information from models. * `flextable`: Support spanning column headers * `datasummary_correlation()` gets a `star` argument. * `datasummary_correlation()` accepts objects produced by the `correlation` package. * `datasummary_balance()`: `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. +* Unnecessary text printed to screen on some F sta computations is now suppressed. * Update to `tinytable` 0.3.0 Bugs: From fb3139ee2df7b34d278700e80eb38cd30e7d2eae Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 18 May 2024 15:48:40 -0400 Subject: [PATCH 2/7] no remotes in DESCRIPTION --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index da74316c..02fd8df0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,7 +45,6 @@ Authors@R: c(person("Vincent", "Arel-Bundock", comment = c(ORCID = "0000-0003-2121-5177"))) URL: https://modelsummary.com BugReports: https://github.com/vincentarelbundock/modelsummary/issues/ -Remotes: vincentarelbundock/tinytable Depends: R (>= 4.0.0) Imports: From 2b0046c2f96a5b4d3b11a4130bf7f5b151da7f9d Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 18 May 2024 15:50:12 -0400 Subject: [PATCH 3/7] docs --- R/datasummary_correlation.R | 1 + man/datasummary_correlation.Rd | 8 ++++++++ man/datasummary_correlation_format.Rd | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/R/datasummary_correlation.R b/R/datasummary_correlation.R index f141d984..0c488a25 100644 --- a/R/datasummary_correlation.R +++ b/R/datasummary_correlation.R @@ -8,6 +8,7 @@ #' * https://modelsummary.com/articles/datasummary.html #' #' @inheritParams datasummary +#' @inheritParams modelsummary #' @param method character or function #' \itemize{ #' \item character: "pearson", "kendall", "spearman", or "pearspear" diff --git a/man/datasummary_correlation.Rd b/man/datasummary_correlation.Rd index 9754e4e2..7da30498 100644 --- a/man/datasummary_correlation.Rd +++ b/man/datasummary_correlation.Rd @@ -86,6 +86,14 @@ your main table.} \item{escape}{boolean TRUE escapes or substitutes LaTeX/HTML characters which could prevent the file from compiling/displaying. \code{TRUE} escapes all cells, captions, and notes. Users can have more fine-grained control by setting \code{escape=FALSE} and using an external command such as: \code{modelsummary(model, "latex") |> tinytable::format_tt(tab, j=1:5, escape=TRUE)}} +\item{stars}{to indicate statistical significance +\itemize{ +\item FALSE (default): no significance stars. +\item TRUE: +=.1, *=.05, **=.01, ***=0.001 +\item Named numeric vector for custom stars such as \code{c('*' = .1, '+' = .05)} +\item Note: a legend will not be inserted at the bottom of the table when the \code{estimate} or \code{statistic} arguments use "glue strings" with \code{{stars}}. +}} + \item{...}{other parameters are passed through to the table-making packages.} } diff --git a/man/datasummary_correlation_format.Rd b/man/datasummary_correlation_format.Rd index 4d38b69e..ba8322fa 100644 --- a/man/datasummary_correlation_format.Rd +++ b/man/datasummary_correlation_format.Rd @@ -38,6 +38,14 @@ diagonal are replaced by the same character (e.g., "1").} \item{upper_triangle}{character or NULL. If character, all elements of the upper triangle are replaced by the same character (e.g., "" or ".").} + +\item{stars}{to indicate statistical significance +\itemize{ +\item FALSE (default): no significance stars. +\item TRUE: +=.1, *=.05, **=.01, ***=0.001 +\item Named numeric vector for custom stars such as \code{c('*' = .1, '+' = .05)} +\item Note: a legend will not be inserted at the bottom of the table when the \code{estimate} or \code{statistic} arguments use "glue strings" with \code{{stars}}. +}} } \description{ Mostly for internal use, but can be useful when users supply a function to From 28f7adf40db80a7a7a4efd7db6adbfe96d57b44f Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 18 May 2024 15:51:58 -0400 Subject: [PATCH 4/7] message --- R/zzz.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/R/zzz.R b/R/zzz.R index 951213ce..e4d864b7 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -5,10 +5,8 @@ "Revert to `kableExtra` for one session:", "", " options(modelsummary_factory_default = 'kableExtra')", -"", -"Change the default backend persistently:", -"", -" config_modelsummary(factory_default = 'gt')", +" options(modelsummary_factory_latex = 'kableExtra')", +" options(modelsummary_factory_html = 'kableExtra')", "", "Silence this message forever:", "", From 9e08e907838c2043c9ecd43476bf24d9ef90182e Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 18 May 2024 15:52:57 -0400 Subject: [PATCH 5/7] namespace --- NAMESPACE | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 607a68c6..d73a6d62 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -76,19 +76,3 @@ import(tables) importFrom(generics,glance) importFrom(generics,tidy) importFrom(methods,formalArgs) -importFrom(tables,All) -importFrom(tables,AllObs) -importFrom(tables,Arguments) -importFrom(tables,DropEmpty) -importFrom(tables,Factor) -importFrom(tables,Format) -importFrom(tables,Heading) -importFrom(tables,Multicolumn) -importFrom(tables,Paste) -importFrom(tables,Percent) -importFrom(tables,PlusMinus) -importFrom(tables,RowFactor) -importFrom(tables,RowNum) -importFrom(tables,colLabels) -importFrom(tables,labelSubset) -importFrom(tables,rowLabels) From ebc7a7765d1562e549d19c65558655f7dca03729 Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 18 May 2024 15:54:04 -0400 Subject: [PATCH 6/7] namespace --- NAMESPACE | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index d73a6d62..607a68c6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -76,3 +76,19 @@ import(tables) importFrom(generics,glance) importFrom(generics,tidy) importFrom(methods,formalArgs) +importFrom(tables,All) +importFrom(tables,AllObs) +importFrom(tables,Arguments) +importFrom(tables,DropEmpty) +importFrom(tables,Factor) +importFrom(tables,Format) +importFrom(tables,Heading) +importFrom(tables,Multicolumn) +importFrom(tables,Paste) +importFrom(tables,Percent) +importFrom(tables,PlusMinus) +importFrom(tables,RowFactor) +importFrom(tables,RowNum) +importFrom(tables,colLabels) +importFrom(tables,labelSubset) +importFrom(tables,rowLabels) From 09665c7880d6747fa747e806b817faa8148bdd0c Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sun, 19 May 2024 08:18:53 -0400 Subject: [PATCH 7/7] bug --- R/methods_stats.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/methods_stats.R b/R/methods_stats.R index ff0d5725..0274f956 100644 --- a/R/methods_stats.R +++ b/R/methods_stats.R @@ -20,6 +20,7 @@ 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 <- NULL if (isTRUE(check_dependency("lmtest"))) { void <- utils::capture.output(fstat <- try(lmtest::waldtest(x, vcov = stats::vcov)$F[2], silent = TRUE)) }