Skip to content

Commit

Permalink
clarify msg
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Feb 4, 2024
1 parent 6f153be commit 8d9299e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion R/check_collinearity.R
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ check_collinearity.zerocount <- function(x,
if (is.null(v)) {
if (isTRUE(verbose)) {
insight::format_alert(
sprintf("Could not extract the variance-covariance matrix for the %s component of the model.", component)
paste(
sprintf("Could not extract the variance-covariance matrix for the %s component of the model.", component),
"Please try to run `vcov(model)`, which may help identifying the problem."
)
)
}
return(NULL)
Expand Down
9 changes: 6 additions & 3 deletions R/check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,15 @@ check_model.default <- function(x,
suppressWarnings(.check_assumptions_glm(x, minfo, verbose, ...))
},
error = function(e) {
NULL
e
}
)

if (is.null(ca)) {
insight::format_error(paste0("`check_model()` not implemented for models of class `", class(x)[1], "` yet."))
if (inherits(ca, c("error", "simpleError"))) {
insight::format_error(
paste("\n`check_model()` returned following error:", ca$message),
paste0("\nIf the error message does not help identifying your problem, another reason why `check_model()` failed might be that models of class `", class(x)[1], "` are not yet supported.") # nolint
)
}

# try to find sensible default for "type" argument
Expand Down
7 changes: 6 additions & 1 deletion R/check_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,12 @@ check_outliers.default <- function(x,

# sanity check for date, POSIXt and difftime variables
if (any(vapply(my_data, inherits, FUN.VALUE = logical(1), what = c("Date", "POSIXt", "difftime"))) && verbose) {
insight::format_alert("Date variables are not supported for outliers detection. These will be ignored.")
insight::format_alert(
paste(
"Date variables are not supported for outliers detection. These will be ignored.",
"Make sure any date variables are converted to numeric or factor {.b before} fitting the model."
)
)
}

# Remove non-numerics
Expand Down

0 comments on commit 8d9299e

Please sign in to comment.