Checks each indicator wired in ine_variables for its latest published year (via get_ine_demog()) and, if newer than the local cache, downloads and caches it for offline use.

update_ine_data(force = FALSE, data_dir)

Arguments

force

Logical, force update even if data is current.

data_dir

Character, directory for cached data. No default: this function only writes when a directory is explicitly supplied, per CRAN policy against writing to the user's home filespace by default. Pass e.g. tools::R_user_dir("inedemogR", "cache") for a persistent cache.

Value

Invisibly, a named list of the latest cached year per indicator.

Examples

if (FALSE) { # \dontrun{
# Not run: requires live network access to the INE API, and writes to
# the supplied cache directory.
update_ine_data(data_dir = tools::R_user_dir("inedemogR", "cache"))
} # }