R/zzz_on_attach.R

Defines functions .onAttach is_attached

load <- c("DT")

.onAttach <- function(...) {
    needed <- load[!is_attached(load)]

    if (length(needed) == 0)
        return()

    suppressPackageStartupMessages(
        lapply(needed, library, character.only = TRUE, warn.conflicts = FALSE)
    )
}

is_attached <- function(x) {
    paste0("package:", x) %in% search()
}
vadimus202/datatableEZ documentation built on May 3, 2019, 2:41 p.m.