Skip to content

Commit 3e81292

Browse files
committed
minor fix for forthcoming changes in {performance}
1 parent c30720d commit 3e81292

3 files changed

Lines changed: 18 additions & 1 deletion

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: see
33
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
4-
Version: 0.13.0
4+
Version: 0.13.0.1
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# see (devel)
2+
3+
## Changes
4+
5+
* Updated plot-method for `performance::check_model()` for Bayesian ordinal
6+
models.
7+
18
# see 0.13.0
29

310
## Breaking Changes

R/plot.check_predictions.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ data_plot.performance_pp_check <- function(x, type = "density", ...) {
1515
}
1616

1717
columns <- colnames(x)
18+
19+
# preparation for ordinal models - we may have numeric values for simulated
20+
# response, but ordered for original response. Fix this here.
21+
if (is.ordered(x$y) && is.numeric(x$sim_1)) {
22+
sims <- startsWith(colnames(x), "sim_")
23+
x[sims] <- lapply(x[sims], function(i) {
24+
factor(i, labels = levels(x$y), ordered = TRUE)
25+
})
26+
}
27+
1828
dataplot <- stats::reshape(
1929
x,
2030
times = columns,

0 commit comments

Comments
 (0)