File tree Expand file tree Collapse file tree 2 files changed +8
-19
lines changed Expand file tree Collapse file tree 2 files changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,14 @@ as_factor_from_class_pred <- function(x, call = caller_env()) {
67
67
return (x )
68
68
}
69
69
70
- if (! is_installed(" probably" )) {
71
- check_installed(
72
- pkg = " probably" ,
73
- reason = cli :: format_inline(" \n A {.cls class_pred} input was detected and {.pkg probably} is required to convert {.cls class_pred} to {.cls factor}." ),
74
- call = call
75
- )
76
- }
70
+ check_installed(
71
+ pkg = " probably" ,
72
+ reason = cli :: format_inline(
73
+ " \n A {.cls class_pred} input was detected and {.pkg probably} is required to convert {.cls class_pred} to {.cls factor}."
74
+ ),
75
+ call = call
76
+ )
77
+
77
78
probably :: as.factor(x )
78
79
}
79
80
Original file line number Diff line number Diff line change @@ -368,16 +368,4 @@ test_that("work with class_pred input", {
368
368
369
369
fct_estimate <- two_class_example $ predicted
370
370
fct_estimate [2 ] <- NA
371
-
372
- local_mocked_bindings(
373
- .package = " rlang" ,
374
- detect_installed = function (pkg , ... ) {
375
- FALSE
376
- }
377
- )
378
-
379
- expect_snapshot(
380
- error = TRUE ,
381
- accuracy_vec(fct_truth , cp_estimate )
382
- )
383
371
})
You can’t perform that action at this time.
0 commit comments