Listen very carefully. I shall say this only once.
The onetime package provides convenience functions to run R code only once (ever) per user. For example, you can:
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.
Development documentation is at https://hughjonesd.github.io/onetime/dev/.
library(onetime)
ids <- paste0("onetime-readme-", 1:3)
for (i in 1:5) {
onetime_do(cat("This command will only be run once.\n"), id = ids[1])
onetime_warning("This warning will only be shown once.", id = ids[2])
onetime_message("This message will only be shown once.", id = ids[3])
}
#> This command will only be run once.
#> Warning: This warning will only be shown once.
#> This message will only be shown once.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")
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.