R/extract.R

Defines functions extract_parameter_dials.parameters

#' @export
extract_parameter_dials.parameters <- function(x, parameter, ...) {
  check_dots_empty()
  check_string(parameter, allow_empty = FALSE)

  which_id <- which(x$id == parameter)
  if (length(which_id) == 0) {
    cli::cli_abort("No parameter exists with id {.val {parameter}}.")
  }

  x$object[[which_id]]
}

Try the dials package in your browser

Any scripts or data that you put into this service are public.

dials documentation built on Sept. 11, 2024, 8:25 p.m.