| gb_set_cache_dir | R Documentation |
Sets the active cache directory and optionally saves it for future sessions.
Use gb_detect_cache_dir() to find the active cache directory.
gb_set_cache_dir(
cache_dir = NULL,
overwrite = FALSE,
install = FALSE,
quiet = FALSE
)
cache_dir |
A path to a cache directory. If |
overwrite |
A logical value. If |
install |
A logical value. If |
quiet |
A logical value. If |
By default, when no cache_dir is set, geobounds uses a directory
inside base::tempdir(). Cached archives in this directory are removed when
the R session ends. To reuse a cache directory across R sessions, use
gb_set_cache_dir(cache_dir = "a/path/here", install = TRUE). This saves the
directory in the user configuration path returned by
tools::R_user_dir().
An invisible character scalar containing the path to the cache directory.
For occasional use, use the default temporary cache directory.
Set the cache directory for the current session with
gb_set_cache_dir(cache_dir = "a/path/here").
Save a persistent cache directory for future R sessions with
gb_set_cache_dir(cache_dir = "a/path/here", install = TRUE).
Set the cache directory for an individual download with the cache_dir
argument. See gb_get().
gb_get() and gb_get_world() use the configured cache directory for
downloaded boundary archives.
tools::R_user_dir() identifies standard locations for user-specific files.
Cache management functions:
gb_clear_cache(),
gb_detect_cache_dir()
# Caution: this may modify your current state.
## Not run:
my_cache <- gb_detect_cache_dir()
# Set an example cache directory.
ex <- file.path(tempdir(), "example", "cachenew")
gb_set_cache_dir(ex)
gb_detect_cache_dir()
# Restore the initial cache.
gb_set_cache_dir(my_cache)
identical(my_cache, gb_detect_cache_dir())
## End(Not run)
gb_detect_cache_dir()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.