Skip to content

Commit

Permalink
Misleading names using pretty_names in combination with cut()
Browse files Browse the repository at this point in the history
Fixes #943
  • Loading branch information
strengejacke committed Feb 6, 2024
1 parent 12c6389 commit ae0b7d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/format_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,11 @@ format_parameters.parameters_model <- function(model, ...) {
if (all(grepl(pattern_cut_right, level))) {
lower_bounds <- gsub(pattern_cut_right, "\\1", level)
upper_bounds <- gsub(pattern_cut_right, "\\2", level)
level <- paste0(as.numeric(lower_bounds) + 1, "-", upper_bounds)
level <- paste0(">", as.numeric(lower_bounds), "-", upper_bounds)
} else if (all(grepl(pattern_cut_left, level))) {
lower_bounds <- gsub(pattern_cut_left, "\\1", level)
upper_bounds <- gsub(pattern_cut_left, "\\2", level)
level <- paste0(lower_bounds, "-", as.numeric(upper_bounds) - 1)
level <- paste0(lower_bounds, "-<", as.numeric(upper_bounds))
}
paste0(variable, " ", brackets[1], level, brackets[2])
}
Expand Down

0 comments on commit ae0b7d2

Please sign in to comment.