download_selected_files {geogenr} | R Documentation |
Download selected files
Description
Download the files that have been selected and have not been downloaded yet, unzip them (if desired) and, if everything went well and is indicated in the parameter, delete the downloaded files.
Usage
download_selected_files(ac, subdir = NULL, unzip = TRUE, delete_zip = FALSE)
Arguments
ac |
An |
subdir |
NULL/'year'/'area', output subdir. |
unzip |
A boolean, unzip files. |
delete_zip |
A boolean, delete zip files if correctly unzipped. |
Details
In the subdir
parameter, the values NULL, 'year' or 'area' can be indicated.
With NULL it does not create any subdirs, with 'year' it creates them by years
of downloaded files and with 'area' it creates them by areas.
Value
A vector, files correctly obtained.
See Also
Other data download functions:
acs_5yr()
,
get_area_file_names()
,
get_area_groups()
,
get_area_years()
,
get_areas()
,
get_selected_file_names()
,
get_too_heavy_file_names()
,
select_area_files()
,
unzip_files()
Examples
dir <- system.file("extdata/acs_5yr", package = "geogenr")
ac <- acs_5yr(dir)
ac <- ac |>
select_area_files("Alaska Native Regional Corporation", 2020:2021)
files <- ac |>
download_selected_files(unzip = FALSE)