Skip to contents

Configures whether the cache should be temporary (per-session) or persistent across sessions.

Usage

gutenberg_set_cache(
  type = getOption("gutenbergr_cache_type", "session"),
  verbose = TRUE
)

Arguments

type

Either "session" (default) or "persistent".

  • "session": Files are stored in a tempdir(). This is the default behavior.

  • "persistent": Files are stored in an OS-specific user cache directory. These files persist across sessions, preventing redundant downloads of the same files in the future.

verbose

Whether to show the status message confirming the path.

Value

The active cache path (invisibly).

Details

The cache type can also be set with an option:

options(gutenbergr_cache_type = "persistent")