download_ban.Rd
Function used to downlaod BAN
download_ban(
destination,
origin = "data.gouv",
name = NULL,
extension = NULL,
date = NULL,
version = NULL,
department = NULL,
region = NULL,
verbose = TRUE
)
character, the address where dara are stocked.
character, either a keyword or the address from where data are downloaded. See details.
character, vector of acceptable names fo archive to be downloaded.
character, vector of acceptable types of archive to be downloaded.
character, date of the archive to be downloaded.
string, version of BAN to be downloaded. See details.
integer, or converted to integer. Departments that should be considered. See details.
integer, or converted to integer. Regions that should be considered. See details.
logical, should the function send some messages while running.
nothing
If origin == "data.gouv"
, then all necessary variables are filled with
those values:
origin is changed to "https://adresse.data.gouv.fr/data/ban/adresses"
name default value is changed to "adresses"
extension default value is changed to "csv.gz"
date default value is used to choose a given directory. If date is null, then the most recent version is taken (equivalent to "latest").
version must be something within "ban" or "bal". When "ban" is used the file with one position per address is used. When "bal" is used, the file with several position per address is used.
department is used. Should be admissible French
departments (a formatting will be attempted with format_scope
).
If NULL, region may be used. If both are NULL, all departments from
floodam.data::department will be used.
region may be used if department is null. Should be
admissible French regions (a formatting will be attempted with
format_scope
). If region is given and department is NULL, all
departments from given region will be used.
If not, everything shall be filled so that download_archive
can make
a successful download.
if (FALSE) {
destination = tempdir()
download_ban(destination)
download_ban(destination, department = 34)
download_ban(destination, department = 34, date = "2022-01-01")
download_ban(destination, region = 11, date = "2022-01-01")
download_ban(destination, department = 34, date = "2022-09-20", version = "bal")
unlink(destination)
}