Skip to content

Commit d26b90c

Browse files
committed
modelsummary's coef_rename doesn't work with avg_comparisons
Fixes #1238
1 parent 17f3897 commit d26b90c

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: parameters
33
Title: Processing of Model Parameters
4-
Version: 0.29.2.1
4+
Version: 0.29.2.2
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",

R/format_parameters.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ format_parameters.parameters_model <- function(model, ...) {
440440
}
441441

442442
# validation check
443-
if (!is.null(model) && insight::is_regression_model(model) && !is.data.frame(model)) {
443+
if (.is_valid_model_input(model)) {
444444
# get data, but exclude response - we have no need for that label
445445
mf <- insight::get_data(model, source = "mf", verbose = FALSE)
446446
# sanity check - any labels (value labels)?
@@ -601,6 +601,13 @@ format_parameters.parameters_model <- function(model, ...) {
601601

602602
# helper -------------------
603603

604+
.is_valid_model_input <- function(model) {
605+
!is.null(model) &&
606+
((insight::is_regression_model(model) && !is.data.frame(model)) ||
607+
inherits(model, c("predictions", "comparisons", "slopes")))
608+
}
609+
610+
604611
.unicode_symbols <- function() {
605612
# symbols only work on windows from R 4.2 and higher
606613
win_os <- tryCatch(

0 commit comments

Comments
 (0)