Core function used to downlaod archives

download_archive(
  to_do,
  extension = c("gz", "zip", "7z"),
  name = NULL,
  date = NULL,
  version = NULL,
  html = "simple",
  verbose = FALSE
)

Arguments

to_do

data.frame. Two columns of character are expected.

extension

character, vector of acceptable types of archive to be downloaded.

name

character, vector of acceptable names fo archive to be downloaded

date

character, something like a date that should be used as a filter.

version

character, something like a version that should be used as a filter.

html

character, indicates if the page is "simple" or is coming from "data.gouv". This has implications on how to look for links.

verbose

logical, should the function send somme messages while running.

Value

nothing

Details

This function is used by other more specific functions. It takes as input a to_do data.frame giving correspondance between origin urls to local destinations. It also to select some types of archives to be downloaded. On the good construction of the to_do data.frame depends the success of the downloads!

Examples

if (FALSE) {
destination = tempdir()
to_do_cquest = data.frame(
 origin = "https://data.cquest.org/registre_parcellaire_graphique/2018",
 destination = destination,
 short = "rpg_cquest",
 stringsAsFactors = FALSE
)
download_archive(to_do_cquest, version = "D976", verbose = TRUE)

to_do_ign = data.frame(
 origin = "https://geoservices.ign.fr/rpg",
 destination = destination,
 short = "rpg_ign",
 stringsAsFactors = FALSE
)
download_archive(to_do_ign, version = "D976", date = "2020", verbose = TRUE)
download_archive(to_do_ign, version = "D976", verbose = TRUE)

to_do = rbind(to_do_cquest, to_do_ign)
download_archive(to_do, version = "D976", verbose = TRUE)
}