R/zzz.R

Defines functions .onAttach .onLoad

## covr: skip=all

# Allows conflicts. For more information, see library() and
# conflicts() in [R] base.
.conflicts.OK <- TRUE

.onLoad <- function(libname, pkgname) {
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # Register vignette engines
  # NOTE: Are we doing this here because of backward compatibility
  #       issues, e.g. early version of R 3.0.x? /HB 2013-09-28
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  try({
    vignetteEngine <- get("vignetteEngine", envir=asNamespace("tools"))
    # Add vignette engine, iff missing.  But why?!? /HB 2013-09-28
    if (is.element("R.rsp::rsp", names(tools::vignetteEngine()))) {
      vignetteEngine("rsp", package=pkgname, pattern="[.][^.]*[.]rsp$",
                      weave=R.rsp::rspWeave, tangle=R.rsp::rspTangle)
    }
  }, silent=TRUE)
  ns <- getNamespace(pkgname)
  pkg <- Package(pkgname)
  assign(pkgname, pkg, envir=ns)

  # Set default global options when package is loaded
  devOptions("*", reset=TRUE)
}


.onAttach <- function(libname, pkgname) {
  startupMessage(get(pkgname, envir=getNamespace(pkgname)))
}

Try the R.devices package in your browser

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

R.devices documentation built on Oct. 30, 2019, 10:58 a.m.