File: zzz.R

package info (click to toggle)
r-cran-r.methodss3 1.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 300 kB
  • sloc: sh: 12; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 719 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## covr: skip=all
.onLoad <- function(libname, pkgname) {
  value <- getOption("R.methodsS3:useSearchPath", NULL)
  if (is.null(value)) {
    value <- Sys.getenv("R_R_METHODSS3_USE_SEARCH_PATH", "TRUE")
    value <- isTRUE(as.logical(value))
    options("R.methodsS3:useSearchPath" = value)
  }
}


.onAttach <- function(libname, pkgname) {
  pd <- utils::packageDescription(pkgname)
  msg <- sprintf("%s v%s", pkgname, pd$Version)
  
  field <- intersect(c("Date/Publication", "Date"), names(pd))
  if (length(field) > 0L) {
    date <- pd[[field[1]]]
    if (!is.na(date)) msg <- sprintf("%s (%s)", msg, date)
  }
  msg <- sprintf("%s successfully loaded. See ?%s for help.", msg, pkgname)
  pkgStartupMessage(msg)
}