Skip to contents

Either downloads the necessary data for all modules from Eurostat using dataset ids or loads the files provided in the user-specified input directory and selects the required variables.

Usage

load_or_download_variables(
  specification,
  dictionary = NULL,
  primary_source = c("download", "local"),
  inputdata_directory = NULL,
  save_to_disk = NULL,
  quiet = FALSE,
  constrain.to.minimum.sample = TRUE
)

Arguments

specification

A tibble or data.frame as returned by check_config_table.

dictionary

A tibble or data.frame storing the Eurostat variable code in column 'eurostat_code'. If download == TRUE then the dictionary also requires column named 'dataset_id' that stores the Eurostat dataset id. When NULL, the default dictionary is used.

primary_source

A character of length 1 determining whether the required variables are first obtained from "download" and then "local"ly or vice versa.

inputdata_directory

A path to .rds, .csv, or .xlsx input files in which the data is stored. Can be NULL, in which case data is obtained via download if possible.

save_to_disk

A path to a directory where the final dataset will be saved, including file name and ending. Not saved when NULL.

quiet

Logical with default = FALSE. Should messages be displayed? These messages are intended to give more information about the estimation and data retrieval process.

constrain.to.minimum.sample

Logical. Should all data series be constrained to the minimum data series? Default is TRUE.