The cache directory is used to store data locally, so that they can be used offline later. If called with no arguments (i.e. qa_cache_dir()), this function returns the current cache directory. By default, this is a per-session temporary directory. Calling with a path argument will set the cache directory to that path.

qa_cache_dir(path, verbose = FALSE)

Arguments

path

string: (optional) Values can be "session" (a per-session temporary directory will be used, default), "persistent" (the directory returned by rappdirs::user_cache_dir will be used), or a string giving the path to the directory to use. An attempt will be made to create the cache directory if it does not exist

verbose

logical: show progress messages?

Value

The path to the cache directory

See also

Examples


## return the current cache directory
qa_cache_dir()
#> [1] "/tmp/RtmpOBRgtN/quantarcticR-cache"

## set the cache directory to a location that persists across
##  user sessions
qa_cache_dir("persistent")
#> [1] "~/.cache/quantarcticR"

## switch to a per-session cache
qa_cache_dir("session")
#> [1] "/tmp/RtmpOBRgtN/quantarcticR-cache"