Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Apr 5, 2024
1 parent 2456d1b commit 0e4b7aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: see
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
Version: 0.8.3.5
Version: 0.8.3.6
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
* `plot()` for `check_predictions()` now supports Bayesian regression models from
*brms* and *rstanarm*.

## Bug fixes

* Corrected order of models for `plot.compare_parameters()`.

# see 0.8.3

## Major changes
Expand Down
8 changes: 7 additions & 1 deletion R/plot.compare_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ plot.see_compare_parameters <- function(x,
x$Component <- factor(x$Component, levels = unique(x$Component))
}


# show/hide intercepts
if (!show_intercept) {
x <- x[!.is_intercept(x$Parameter), ]
# sanity check - any data left?
if (nrow(x) == 0) {
insight::format_warning("No data left after removing intercepts. Returning empty plot.")

Check warning on line 83 in R/plot.compare_parameters.R

View check run for this annotation

Codecov / codecov/patch

R/plot.compare_parameters.R#L82-L83

Added lines #L82 - L83 were not covered by tests
}
}

if (isTRUE(sort) || (!is.null(sort) && sort == "ascending")) {
Expand Down Expand Up @@ -224,6 +228,8 @@ data_plot.see_compare_parameters <- function(x, ...) {
}

dataplot$group <- gsub("(.*)\\.(.*)", "\\2", dataplot$group)
# make factor, so order in legend is preserved
dataplot$group <- factor(dataplot$group, levels = unique(dataplot$group))

Check warning on line 232 in R/plot.compare_parameters.R

View check run for this annotation

Codecov / codecov/patch

R/plot.compare_parameters.R#L232

Added line #L232 was not covered by tests

rownames(dataplot) <- NULL

Expand Down

0 comments on commit 0e4b7aa

Please sign in to comment.