onetime

Run R code just once

OTHER License

Downloads
223
Stars
1
Committers
2

output: github_document

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

onetime

Listen very carefully. I shall say this only once.

Michelle Dubois, 'Allo 'Allo

The onetime package provides convenience functions to run R code only once (ever) per user. For example, you can:

  • Show a startup message only the first time (ever) that a package is loaded.
  • Run cleanup code just once after an upgrade.
  • Show the user a message, with the option not to show it again.

Onetime is a lightweight package. It requires just two package dependencies, rappdirs and filelock, with no further indirect dependencies. The total size including these dependencies is less than 50 Kb.

Installation

Install onetime from r-universe:

install.packages("onetime", repos = c("https://hughjonesd.r-universe.dev", 
                                      "https://cloud.r-project.org"))

Or on CRAN:

install.packages("onetime")

Or install the development version from github with:

# install.packages("remotes")
remotes::install_github("hughjonesd/onetime")