R/zzz.R

Defines functions .onLoad show_progress .onAttach

.onAttach <- function(lib, pkg) {
  packageStartupMessage("This is peruflorads043_2006_ag ",
                        utils::packageDescription("peruflorads43",
                                                  fields = "Version"
                        ),
                        appendLF = TRUE
  )
}


# -------------------------------------------------------------------------

show_progress <- function() {
  isTRUE(getOption("peruflorads043.show_progress")) && # user disables progress bar
    interactive() # Not actively knitting a document
}



.onLoad <- function(libname, pkgname) {
  opt <- options()
  opt_peruflorads043 <- list(
    peruflorads043.show_progress = TRUE
  )
  to_set <- !(names(opt_peruflorads043) %in% names(opt))
  if (any(to_set)) options(opt_peruflorads043[to_set])
  invisible()
}


# -------------------------------------------------------------------------

Try the peruflorads43 package in your browser

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

peruflorads43 documentation built on Aug. 21, 2023, 5:14 p.m.