R/zzz.R

Defines functions random_tip .onAttach

.onAttach <- function(libname, pkgname) {
  tip <- random_tip()
  packageStartupMessage(paste(strwrap(tip), collapse = "\n"))
}

random_tip <- function() {
  # Idea from https://github.com/bpbond/cosore/blob/master/R/zzz.R
  # and https://github.com/tidyverse/ggplot2/blob/master/R/zzz.r
  tips <- c(
    "Willkommen, Bienvenue, Welcome!",
    "Use `citation('nmrrr') to cite this package"
  )

  sample(tips, 2)
}

Try the nmrrr package in your browser

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

nmrrr documentation built on May 31, 2023, 6:35 p.m.