Learn R Programming

rerddap (version 0.5.0)

cache_setup: Setup cache path

Description

Setup cache path

Usage

cache_setup(path_suffix = NULL, temp_dir = FALSE)

cache_info()

Arguments

path_suffix

(character) the path suffix to use for storing cached files, appended to user cache dir.

temp_dir

(logical) if TRUE use a randomly assigned tempdir (and path_suffix is ignored), if FALSE, you can use path_suffix.

Value

the full cache path, a directory (character)

Details

Looks first if the user has set a cache path suffix in an env var or R option. If not found, proceeds to use a temp directory if not in interactive mode, but if interactive, asks user to setup a default cache location that will work across sessions (but user can say no, in which case a temp directory will be used, and each package start will require cache setup again)

See Also

Other cache: cache_delete, cache_details, cache_list

Examples

Run this code
# NOT RUN {
# default path
cache_setup()

# you can define your own path
cache_setup(path = "foobar")

# set a tempdir - better for programming with to avoid prompt
cache_setup(temp_dir = TRUE)

# cache info
cache_info()
# }

Run the code above in your browser using DataLab