Skip to content

Commit 9e790bc

Browse files
topeposimonpcouch
andauthored
Apply suggestions from code review
Co-authored-by: Simon P. Couch <[email protected]>
1 parent 903ad52 commit 9e790bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/misc.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ check_outcome <- function(y, spec) {
371371
if (!outcome_is_numeric) {
372372
cli::cli_abort(
373373
"For a regression model, the outcome should be {.cls numeric}, not
374-
{.cls {class(y)[[1]]}}."
374+
{.obj_type_friendly {y}}."
375375
)
376376
}
377377
}
@@ -380,8 +380,8 @@ check_outcome <- function(y, spec) {
380380
outcome_is_factor <- if (is.atomic(y)) {is.factor(y)} else {all(map_lgl(y, is.factor))}
381381
if (!outcome_is_factor) {
382382
cli::cli_abort(
383-
"For a classification model, the outcome should be {.cls factor}, not
384-
{.cls {class(y)[[1]]}}."
383+
"For a classification model, the outcome should be a {.cls factor}, not
384+
{.obj_type_friendly {y}}."
385385
)
386386
}
387387

0 commit comments

Comments
 (0)