R/zzz.R

Defines functions .onLoad

.onLoad <- function(libname, pkgname) {
  # Prevent NOTEs from R CMD check
  requireNamespace("proxy", quietly = TRUE)

  # Register twdtw distance function
  if("twdtw" %in% names(proxy::pr_DB$get_entries())) {
    proxy::pr_DB$delete_entry("twdtw")
  }
  proxy::pr_DB$set_entry(FUN = function(x, y, ...) twdtw(x, y, ...), names = c("twdtw"), distance = TRUE, loop = FALSE)

  invisible(NULL)

}

Try the twdtw package in your browser

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

twdtw documentation built on Aug. 8, 2023, 9:06 a.m.