change_cache {f1dataR} | R Documentation |
Change Caching Settings
Description
Change caching settings for the package. By default, the cache will be set to keep the results of function calls in memory to reduce the number of requests made to online services for the same data. However, if preferred, the cache can be set to a file directory to make the results persist between sessions.
This is a particularly good idea if you're using functions like load_driver_telemetry()
,
load_session_laps()
, load_race_session()
or plot_fastest()
as they take
significant time and download large amounts of data each time you run the function.
If preferred for testing or waiting for data updates on race weekends, you may wish to
set the cache to 'off'
instead.
Changes to cache can be made for the session (mark the argument persist
as FALSE
)
or apply to the next session(s) by setting persist
to TRUE
Usage
change_cache(cache = "memory", create_dir = FALSE, persist = FALSE)
Arguments
cache |
One of If the selection is |
create_dir |
Whether to create the directory if it doesn't already exist if
a path cache directory is provided. By default this doesn't occur for provided
cache paths, but will always happen if the cache choice is set to |
persist |
Whether to make this change permanent ( If |
Value
No return, called for side effects
Examples
## Not run:
change_cache("~/f1dataRcache", create_dir = TRUE)
change_cache("off", persist = FALSE)
## End(Not run)