R/check_attach.R

Defines functions check_attach

check_attach <- function(x, nenv) {
  fn <- gsub("^(.*?)::", "", x)
  pkg <- gsub("::(.*?)$", "", x)
  if (!pkg %in% loadedNamespaces()) {
    attachNamespace(pkg)
    if (!exists("toUnload", envir = nenv)) {
      nenv$toUnload <- c()
    }
    nenv$toUnload <- unique(c(nenv$toUnload, sprintf("package:%s", pkg)))
  }
}

Try the sinew package in your browser

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

sinew documentation built on March 31, 2022, 5:06 p.m.