R/zzz.R

Defines functions is_attached .onAttach

# Based on zzz.R from the tidyverse package

.onAttach <- function(...) {
  needed <- core[!is_attached(core)]
  if (length(needed) == 0) {
    return()
  }

  crayon::num_colors(TRUE)
  fpp2_attach()

  if (!"package:conflicted" %in% search()) {
    x <- fpp2_conflicts()
    msg(fpp2_conflict_message(x), startup = TRUE)
  }
}

is_attached <- function(x) {
  paste0("package:", x) %in% search()
}

Try the fpp2 package in your browser

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

fpp2 documentation built on March 7, 2023, 8:36 p.m.