https://github.com/hughjonesd/onetime
Run R code just once
https://github.com/hughjonesd/onetime
r
Last synced: 6 days ago
JSON representation
Run R code just once
- Host: GitHub
- URL: https://github.com/hughjonesd/onetime
- Owner: hughjonesd
- License: other
- Created: 2020-01-17T17:23:45.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-01-20T20:29:21.000Z (9 months ago)
- Last Synced: 2025-10-11T00:44:32.120Z (9 days ago)
- Topics: r
- Language: R
- Homepage: https://hughjonesd.github.io/onetime/dev/
- Size: 1.73 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```[](https://CRAN.R-project.org/package=onetime)
[](https://hughjonesd.r-universe.dev/onetime/)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://github.com/hughjonesd/onetime/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/hughjonesd/onetime?branch=master)# onetime
> Listen very carefully. I shall say this only once.
[Michelle Dubois, *'Allo 'Allo*](https://www.youtube.com/watch?v=M-_5JJmNB6E)
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.* For more information, see the [vignette](https://hughjonesd.github.io/onetime/dev/articles/onetime.html).
* Development documentation is at .
```{r, child = "example.Rmd"}
```## Installation
Install onetime from [r-universe](https://r-universe.dev):
``` r
install.packages("onetime", repos = c("https://hughjonesd.r-universe.dev",
"https://cloud.r-project.org"))
```Or on CRAN:
``` r
install.packages("onetime")
```Or install the development version from github with:
``` r
# install.packages("remotes")
remotes::install_github("hughjonesd/onetime")
```