Downloads ZIP archives for a given dataset. If year or month have length > 1, gets all combinations.

  month = 12,
  dest_dir = NULL,
  redownload = FALSE



A dataset ID. See id column in sp_datasets for a list of available datasets


year, numeric vector of length <= 1 (can take multiple values), 2015-2019 for some datasets, 2010-2020 for others. Defaults to 2018. (see Details for how to work with data across time periods.)


month, numeric vector of length <= 1 (can take multiple values). Must be between 1 and 12. Defaults to 12. (see Details for how to work with data across time periods.)


character. Directory in which downloaded files will be stored. If left unset, will use the statnipokladna.dest_dir option if the option is set, and tempdir() otherwise. Will be created if it does not exist.


Redownload even if file has already been downloaded? Defaults to FALSE.


character string with complete paths to downloaded ZIP archives.


Files are stored in a temp folder as determined by tempdir() or the dest_dir param or the statnipokladna.dest_dir option. and further sorted into subdirectories by dataset, year and month. If saved to tempdir() (the default), downloaded files per session to avoid redownloads.

How data for different time periods is exported differs by dataset. This has significant implications for how you get to usable full-year numbers or time series in different tables. See vignette("statnipokladna") for details on this.

See also


if (FALSE) { budget_2018 <- sp_get_dataset("finm", 2018) budget_mid2018 <- sp_get_dataset("finm", 2018, 6) }