Downloaded archives are stored in a local cache so that a file is never
downloaded twice. Inside the cache, archives keep their server names in
one sub-folder per year and edition (2024/RAIS_VINC_PUB_NORDESTE.7z,
2023-parcial/RAIS_ESTAB_PUB.7z, 2017/PE2017.7z). The location is
resolved in this order:
Details
the
cache_dirargument;the
RAISR_CACHE_DIRenvironment variable;the
raisr.cache_dirR option;a session-scoped folder under
tempdir(), which R removes when the session ends.
Set one of the first three to keep the archives between sessions. The regional files are large (from about 130 MB for the North region to more than 1 GB for Sao Paulo) and change only when a year is re-published, so a persistent cache is strongly recommended.
Examples
rais_cache_dir()
#> [1] "/tmp/RtmpYn5BWc/raisr-cache"
if (FALSE) { # \dontrun{
# Persistent cache for every session:
Sys.setenv(RAISR_CACHE_DIR = "~/dados/rais")
} # }