Learn R Programming

contactsurveys (version 0.1.0)

contactsurveys_dir: Directory for persistent storage of contact surveys

Description

Returns a platform-specific directory for persistent storage of downloaded survey files, powered by tools::R_user_dir(). You can override this by setting the environment variable CONTACTSURVEYS_HOME.

Usage

contactsurveys_dir()

Arguments

Value

the active contactsurveys directory.

Details

By default, download_survey() and list_surveys() use tempdir() so files do not persist across R sessions. To enable persistent caching, pass contactsurveys_dir() as the directory argument, e.g. download_survey(survey, directory = contactsurveys_dir()).

Examples

Run this code

contactsurveys_dir()

## Override with an environment variable:
Sys.setenv(CONTACTSURVEYS_HOME = tempdir())
contactsurveys_dir()
## Unset
Sys.unsetenv("CONTACTSURVEYS_HOME")

Run the code above in your browser using DataLab