Closed HenrikBengtsson closed 5 years ago
Should probably add an argument and corresponding environment variable to force the running off all when
statements. Maybe this could be done by overriding the current time, which also would have the advantage to emulate different timestamps. For example:
$ R_STARTUP_TIME="2019-03-26 11:41:20" R
UPDATE: Although R_STARTUP_TIME
can fake a future timestamp, we might also want to be able to clear the cache, e.g.
$ R_STARTUP_CACHE="reset" R
which by the way can also be done as:
$ Rscript -e "startup:::reset_when_cache()"; R
UPDATE 2019-05-26: Renamed internal reset_agenda()
to reset_when_cache()
.
startup::reset_when_cache()
is now exported.
Just a heads up and call for testing and feedback. I'm prototyping support for processing R startup files (under ~/.Renviron.d/ and ~/.Rprofile.d/) with certain periodicity. In the
feature/agendadevelop branch, you'll now find:For example, the startup file
~/.Rprofile.d/interactive=TRUE/when=hourly/package=fortunes.R
will be processed at most once an hour whenever you launch an interactive R session and you have the 'fortures' package installed. So, to show a random fortune at startup once an hour, do something like:To test it, install it as:
PS. The naming convention is taken from anacron.
UPDATE 2019-03-22: Merged these features in to the 'develop' branch.