R/zzz.R

Defines functions .onUnload .onLoad

.hm_cache <- new.env(FALSE, parent=globalenv())

.onLoad <- function(libname, pkgname) {

  assign("route_cache", new.env(parent=parent.env(environment())), .hm_cache)
  attr(.hm_cache$route_cache,"map") <- "" # no map name yet

  assign("star_cache", new.env(parent=parent.env(environment())), .hm_cache)
  attr(.hm_cache$star_cache,"map") <- "" # no map name yet

  requireNamespace("s2", quietly = TRUE)
  invisible(utils::capture.output(sf::sf_use_s2(TRUE))) # is this rude - changing a state silently?

  requireNamespace("data.table", quietly = TRUE)
}


.onUnload = function(libname, pkgname) {
  # nothing here yet
}
david6marsh/himach documentation built on Oct. 20, 2023, 6:43 p.m.