Learn R Programming

tigris (version 2.1)

tigris_cache_dir: Set the cache directory to store shapefiles with tigris

Description

By default, tigris uses the rappdirs package to determine a suitable location to store shapefiles on the user's computer. However, it is possible that the user would want to store shapefiles in a custom location. This function allows users to set the cache directory, and stores the result in the user's .Renviron so that tigris will remember the location.

Windows users: please note that you'll need to use double-backslashes or forward slashes when specifying your cache directory's path in R.

Usage

tigris_cache_dir(path)

Arguments

path

The full path to the desired cache directory

Examples

Run this code
if (FALSE) {
# Set the cache directory
tigris_cache_dir('PATH TO MY NEW CACHE DIRECTORY')

# Check to see if it has been set correctly
Sys.getenv('TIGRIS_CACHE_DIR')
}

Run the code above in your browser using DataLab