Nothing
#' Telecharger un dataset du recensement / Download a census dataset
#'
#' @param dataset_id L'identifiant du dataset (ex: 2013, "projection") / Dataset identifier (e.g., 2013, "projection")
#' @param force Telecharger meme si le fichier est deja en cache / Logical, whether to force download even if cached
#' @return A character string specifying the local file path to the downloaded/cached file (returned invisibly).
#' @export
#' @examples
#' \donttest{
#' download("projection")
#' }
download <- function(dataset_id, force = FALSE) {
info <- get_dataset_info(dataset_id)
url <- info$url
filename <- info$file_name
if (is.null(url) || is.na(url)) {
stop(sprintf("Aucune URL de telechargement pour le dataset %s", dataset_id))
}
if (is_cached(filename) && !force) {
message(sprintf("Les donnees pour %s sont deja en cache.", dataset_id))
return(invisible(get_cached_file_path(filename)))
}
filepath <- get_cached_file_path(filename)
message(sprintf("Telechargement du dataset %s depuis %s...", dataset_id, url))
res <- httr::GET(url, httr::write_disk(filepath, overwrite = TRUE), httr::progress())
httr::stop_for_status(res)
message(sprintf("Telechargement termine. Fichier sauvegarde sous %s", filepath))
return(invisible(filepath))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.