| inmet_download | R Documentation |
Downloads one or more annual ZIP files from INMET's historical data portal.
Complete archives already in the cache are reused. Interrupted downloads are
kept in a .part file and resumed on the next attempt.
inmet_download(
years = as.integer(format(Sys.Date(), "%Y")),
dest_dir = tools::R_user_dir("rmet", "cache"),
max_tries = 15L,
quiet = FALSE,
force = FALSE
)
years |
Integer vector of years to download. Available years start in 2000. Defaults to the current year. |
dest_dir |
Character. Cache directory. It is created when necessary. |
max_tries |
Positive integer. Maximum attempts per year. |
quiet |
Logical. Suppress progress messages. |
force |
Logical. Download again even when a valid archive is cached. |
Files are first written to <year>.zip.part. A partial file is never exposed
as a complete ZIP. After an integrity check succeeds, the file is atomically
moved to <year>.zip whenever the operating system permits it.
Invisibly, a named character vector containing the paths of all successfully downloaded archives.
inmet_read(), inmet_get(), inmet_extract()
paths <- inmet_download(2023, dest_dir = tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.