Directory for persistent storage of contact surveys
Source:R/contactsurveys-dir.R
contactsurveys_dir.RdReturns 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.
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
contactsurveys_dir()
#> [1] "/home/runner/.local/share/R/contactsurveys"
## Override with an environment variable:
Sys.setenv(CONTACTSURVEYS_HOME = tempdir())
contactsurveys_dir()
#> [1] "/tmp/RtmpWkaeeE"
## Unset
Sys.unsetenv("CONTACTSURVEYS_HOME")