sp_get_dataset | R Documentation |
Downloads ZIP archives for a given dataset. If year
or month
have length > 1, gets all combinations.
sp_get_dataset(
dataset_id,
year,
month = 12,
dest_dir = NULL,
redownload = FALSE
)
dataset_id |
A dataset ID. See |
year |
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 |
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.) |
dest_dir |
character. Directory in which downloaded files will be stored.
If left unset, will use the |
redownload |
Redownload even if file has already been downloaded? Defaults to FALSE. |
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.
character string with complete paths to downloaded ZIP archives.
Other Core workflow:
add_codelist()
,
get_codelist()
,
sp_add_codelist()
,
sp_get_codelist()
,
sp_get_table()
## Not run:
budget_2018 <- sp_get_dataset("finm", 2018)
budget_mid2018 <- sp_get_dataset("finm", 2018, 6)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.