Skip to contents

Sets the directory where downloaded files will be cached. This avoids repeated downloads of the same data.

Usage

set_cache_dir(path = NULL, persistent = FALSE)

Arguments

path

A character string with the path to the cache directory. If NULL, uses a temporary directory (default).

persistent

Logical. If TRUE, the cache directory setting is saved to the user's R profile for future sessions.

Value

Invisibly returns the cache directory path.

See also

Other cache functions: clear_cache(), get_cache_dir(), list_cache()

Examples

if (FALSE) { # \dontrun{
# set a custom cache directory (use tempdir() in examples)
set_cache_dir(file.path(tempdir(), "educabR_cache"))
} # }