Skip to contents

Downloads metadata for ISTAT datasets including dataflows, codelists, and dimensions.

Usage

download_metadata(force_update = FALSE, cache_dir = .istatlab_cache_dir())

Arguments

force_update

Logical indicating whether to force update of cached metadata. Default is FALSE, which uses cached data if available and less than 14 days old

cache_dir

Character string specifying the directory for caching metadata. Defaults to the ISTATLAB_CACHE_DIR environment variable, or "meta" if unset.

Value

A list containing dataflows metadata

Details

The default cache directory is resolved from the ISTATLAB_CACHE_DIR environment variable (Sys.getenv("ISTATLAB_CACHE_DIR", unset = "meta")). Set this variable, for example in .Renviron, to share a single metadata cache across multiple projects; when unset, the local "meta" directory is used.

Examples

if (FALSE) { # \dontrun{
# Download metadata (uses cache if available)
metadata <- download_metadata()

# Force update of metadata
metadata <- download_metadata(force_update = TRUE)
} # }