diff --git a/.github/workflows/html-5-check.yaml b/.github/workflows/html-5-check.yaml
index 1439a3228..f25b4eeaf 100644
--- a/.github/workflows/html-5-check.yaml
+++ b/.github/workflows/html-5-check.yaml
@@ -6,8 +6,8 @@ on:
pull_request:
branches: [main, master]
-name: HTML5 check
+name: html-5-check
jobs:
- HTML5-check:
+ html-5-check:
uses: easystats/workflows/.github/workflows/html-5-check.yaml@main
diff --git a/DESCRIPTION b/DESCRIPTION
index 3b95351d9..19bada6a3 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
-Version: 0.10.5.4
+Version: 0.10.5.5
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
diff --git a/NEWS.md b/NEWS.md
index 40e57d346..47fad4e59 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -7,6 +7,11 @@
the previous method, which used `parallel::detectCores()`. Now you should
set the number of cores via `options(mc.cores = 4)`.
+## Bug fixes
+
+* Fixed issues is `check_model()` for models that used data sets with
+ variables of class `"haven_labelled"`.
+
# performance 0.10.5
## Changes to functions
diff --git a/R/check_model_diagnostics.R b/R/check_model_diagnostics.R
index 3b86799cc..46a64f9c2 100644
--- a/R/check_model_diagnostics.R
+++ b/R/check_model_diagnostics.R
@@ -153,7 +153,7 @@
# prepare data for normality of residuals plot ----------------------------------
.diag_norm <- function(model, verbose = TRUE) {
- r <- try(stats::residuals(model), silent = TRUE)
+ r <- try(as.numeric(stats::residuals(model)), silent = TRUE)
if (inherits(r, "try-error")) {
insight::format_alert(sprintf("Non-normality of residuals could not be computed. Cannot extract residuals from objects of class '%s'.", class(model)[1]))
@@ -174,16 +174,16 @@
if (inherits(model, "lm", which = TRUE) == 1) {
cook_levels <- round(stats::qf(0.5, s$fstatistic[2], s$fstatistic[3]), 2)
- } else if (!is.null(threshold)) {
- cook_levels <- threshold
- } else {
+ } else if (is.null(threshold)) {
cook_levels <- c(0.5, 1)
+ } else {
+ cook_levels <- threshold
}
n_params <- tryCatch(model$rank, error = function(e) insight::n_parameters(model))
infl <- stats::influence(model, do.coef = FALSE)
- resid <- insight::get_residuals(model)
+ resid <- as.numeric(insight::get_residuals(model))
std_resid <- tryCatch(stats::rstandard(model, infl), error = function(e) resid)
@@ -212,8 +212,8 @@
ncv <- tryCatch(
{
data.frame(
- x = stats::fitted(model),
- y = stats::residuals(model)
+ x = as.numeric(stats::fitted(model)),
+ y = as.numeric(stats::residuals(model))
)
},
error = function(e) {