R/start_message.R

Defines functions version .onAttach

#' @importFrom utils packageDescription
#'
.onAttach <- function(libname, pkgname) {

  desc <- packageDescription("misty")
  d1 <- desc$Version
  nk <- paste0(rep(" ", 17 - nchar(d1)))

  packageStartupMessage("|-------------------------------------|\n",
                          paste0("| ", desc$Package, " ", d1," (", substring(desc$Date, first = 1, last = 10), ")"), nk,"|\n" ,
                        "| Miscellaneous Functions T. Yanagida |\n" ,
                        "|-------------------------------------|" )

}

version <- function(pkg = "misty") {

  lib <- dirname(system.file(package = pkg))
  desc <- packageDescription(pkg)

  return(paste(desc$Package, desc$Version, desc$Date,lib))

}

Try the misty package in your browser

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

misty documentation built on Nov. 15, 2023, 1:06 a.m.