-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
upkeepmaintenance, infrastructure, and similarmaintenance, infrastructure, and similar
Description
This function would be more at home in https://github.com/tidymodels/parsnip/blob/main/R/control_parsnip.R
Lines 318 to 330 in dd36a95
| check_control <- function(x) { | |
| if (!is.list(x)) | |
| rlang::abort("control should be a named list.") | |
| if (!isTRUE(all.equal(sort(names(x)), c("catch", "verbosity")))) | |
| rlang::abort("control should be a named list with elements 'verbosity' and 'catch'.") | |
| # based on ?is.integer | |
| int_check <- function(x, tol = .Machine$double.eps^0.5) abs(x - round(x)) < tol | |
| if (!int_check(x$verbosity)) | |
| rlang::abort("verbosity should be an integer.") | |
| if (!is.logical(x$catch)) | |
| rlang::abort("catch should be a logical.") | |
| x | |
| } |
Metadata
Metadata
Assignees
Labels
upkeepmaintenance, infrastructure, and similarmaintenance, infrastructure, and similar