File: zzz.R

package info (click to toggle)
r-cran-recipes 1.0.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,636 kB
  • sloc: sh: 37; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# nocov start

.onLoad <- function(libname, pkgname) {

  # - If tune isn't installed, register the method (`packageVersion()` will error here)
  # - If tune >= 0.1.6.9001 is installed, register the method
  should_register_tune_args_method <- tryCatch(
    expr = utils::packageVersion("tune") >= "0.1.6.9001",
    error = function(cnd) TRUE
  )

  if (should_register_tune_args_method) {
    # `tune_args.recipe()` and friends moved from tune to recipes
    vctrs::s3_register("generics::tune_args", "recipe", tune_args_recipe)
    vctrs::s3_register("generics::tune_args", "step", tune_args_step)
    vctrs::s3_register("generics::tune_args", "check", tune_args_check)
  }
}

# nocov end