The download_data() function accesses and downloads atmospheric,
meteorological, and environmental data from various open-access data
sources.
Usage
download_data(
dataset_name = c("aqs", "ecoregion", "ecoregions", "geos", "goes", "goes_adp", "GOES",
"gmted", "koppen", "koppengeiger", "merra2", "merra", "modis", "narr", "nlcd",
"noaa", "sedac_groads", "sedac_population", "groads", "population", "hms", "smoke",
"tri", "nei", "gridmet", "terraclimate", "huc", "cropscape", "cdl", "prism", "edgar",
"improve", "IMPROVE", "drought", "spei", "eddi", "usdm"),
directory_to_save = NULL,
acknowledgement = FALSE,
hash = FALSE,
nasa_earth_data_token = NULL,
rate_limit = 2,
...
)Arguments
- dataset_name
character(1). Dataset to download.
- directory_to_save
character(1). Directory to save / unzip (if zip files are downloaded) data.
- acknowledgement
logical(1). By setting
TRUEthe user acknowledges that the data downloaded using this function may be very large and use lots of machine storage and memory.- hash
logical(1). By setting
TRUEthe function will return anrlang::hash_file()hash character corresponding to the downloaded files. Default isFALSE.- nasa_earth_data_token
character(1) or NULL. NASA EarthData authentication token. Required for NASA EarthData datasets:
"geos","merra2","modis","sedac_groads"/"groads", and"sedac_population"/"population". Can be a token string, a path to a file containing the token, orNULLto read from theNASA_EARTHDATA_TOKENenvironment variable. Ignored for datasets that do not use NASA EarthData authentication.- rate_limit
numeric(1). Minimum seconds between HTTP requests (default 2). Passed to the underlying download function.
- ...
Additional arguments passed to each download function.
Value
For
hash = FALSE, NULLFor
hash = TRUE, anrlang::hash_filecharacter.Data files will be downloaded and stored in respective sub-directories within
directory_to_save. File format and sub-directory names depend on data source and dataset of interest.
See also
For details of each download function per dataset, Please refer to:
download_aqs:"aqs","AQS"download_ecoregion:"ecoregions","ecoregion"download_geos:"geos"download_goes:"goes","goes_adp","GOES"download_gmted:"gmted","GMTED"download_koppen_geiger:"koppen","koppengeiger"download_merra2: "merra2","merra","MERRA","MERRA2"download_narr:"narr"download_nlcd:"nlcd","NLCD"download_hms:"noaa","smoke","hms"download_groads:"sedac_groads","groads"download_population:"sedac_population","population"download_modis:"modis","MODIS"download_tri:"tri","TRI"download_nei:"nei","NEI"download_gridmet:"gridMET","gridmet"download_terraclimate:"TerraClimate","terraclimate"download_huc:"huc"download_cropscape:"cropscape","cdl"download_prism:"prism"download_edgar:"edgar"download_improve:"improve","IMPROVE"download_drought:"drought","spei","eddi","usdm"
Examples
if (FALSE) { # \dontrun{
download_data(
dataset_name = "narr",
variables = "weasd",
year = 2023,
directory_to_save = tempdir(),
acknowledgement = TRUE,
download = FALSE, # NOTE: download skipped for examples,
remove_command = TRUE
)
} # }