pick_cache_dir: Decide between the new and the legacy package cache...

View source: R/filecache.R

pick_cache_dirR Documentation

Decide between the new and the legacy package cache directory.

Description

After migrating the default cache location to 'tools::R_user_dir', this function decides whether to use the new default directory or the legacy 'rappdirs' directory: the legacy directory is used if it exists and the new one does not, so that users with an existing cache do not have to re-download their files.

Usage

pick_cache_dir(new_dir, legacy_dir)

Arguments

new_dir

string. The path of the new default cache directory (e.g., a subdirectory of 'tools::R_user_dir').

legacy_dir

string. The path of the legacy cache directory (e.g., as returned by 'rappdirs::user_data_dir').

Value

string. Either 'new_dir' or 'legacy_dir', depending on which directories exist.


pkgfilecache documentation built on Sept. 1, 2026, 1:08 a.m.