Skip to contents

Some expensive operations are cached to avoid recomputing them. Intermediate results are stored in a cache directory. Users can set it via habistats.cache_dir option. The default is set with tools::R_user_dir().

Usage

cache_dir()

Value

cache_dir() returns the path to the cache directory.

Details

General recommendation is to set it to a persistent directory with easy access, such as ~/.cache/habistats, not a temporary directory like tempdir(). If you are working on a shared machine with other users, setting the same cache directory will allow you to share the cache.

Examples

old = options(habistats.cache_dir = "~/.cache/habistats-example")

habistats::cache_dir()
#> ~/.cache/habistats-example

if (FALSE) { # \dontrun{
# Calculate the size
fs::dir_info(habistats::cache_dir(), recurse = TRUE)$size |> sum()
} # }

options(old) # reset for this example, not needed in real use