Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: parameters
Title: Processing of Model Parameters
Version: 0.27.0
Version: 0.27.0.1
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
9 changes: 8 additions & 1 deletion R/format_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
} else {
out <- attr(vec, "label", exact = TRUE)
}
if (is.null(out)) {

Check warning on line 403 in R/format_parameters.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/format_parameters.R,line=403,col=7,[coalesce_linter] Use x %||% y instead of if (is.null(x)) y else x.
i
} else {
out
Expand Down Expand Up @@ -446,8 +446,15 @@
for (i in names(interactions)) {
# extract single coefficient names from interaction term
out <- unlist(strsplit(i, ":", fixed = TRUE))
# for on-the-fly conversion of factors, the names of the factors can
# can also contain "factor()" or "as.factor()" - we need to remove these
if (any(grepl("(as\\.factor|factor|as\\.character)", out))) {
out_clean <- gsub("(as\\.factor|factor|as\\.character)\\((.*)\\)(.*)", "\\2", out)
} else {
out_clean <- out
}
# combine labels
labs <- c(labs, paste(sapply(out, function(l) pretty_labels[l]), collapse = " * "))
labs <- c(labs, paste(sapply(out_clean, function(l) pretty_labels[l]), collapse = " * "))
}
# add interaction terms to labels string
names(labs) <- names(interactions)
Expand Down
Loading