download_ecoregion {amadeus} | R Documentation |
Download ecoregion data
Description
The download_ecoregion()
function accesses and downloads United States Ecoregions data from the U.S. Environmental Protection Agency's (EPA) Ecorgions. Level 3 data, where all pieces of information in the higher levels are included, are downloaded.
Usage
download_ecoregion(
epa_certificate_path = system.file("extdata/cacert_gaftp_epa.pem", package = "amadeus"),
certificate_url =
"http://cacerts.digicert.com/DigiCertGlobalG2TLSRSASHA2562020CA1-1.crt",
directory_to_save = NULL,
acknowledgement = FALSE,
download = FALSE,
remove_command = FALSE,
unzip = TRUE,
remove_zip = FALSE,
hash = FALSE
)
Arguments
epa_certificate_path |
character(1). Path to the certificate file for EPA DataCommons. Default is 'extdata/cacert_gaftp_epa.pem' under the package installation path. |
certificate_url |
character(1). URL to certificate file. See notes for details. |
directory_to_save |
character(1). Directory to save data. Two sub-directories will be created for the downloaded zip files ("/zip_files") and the unzipped data files ("/data_files"). |
acknowledgement |
logical(1). By setting |
download |
logical(1). |
remove_command |
logical(1).
Remove ( |
unzip |
logical(1). Unzip zip files. Default |
remove_zip |
logical(1). Remove zip file from
|
hash |
logical(1). By setting |
Value
For
hash = FALSE
, NULLFor
hash = TRUE
, anrlang::hash_file
character.Zip and/or data files will be downloaded and stored in
directory_to_save
.
Note
For EPA Data Commons certificate errors, follow the steps below:
Click Lock icon in the address bar at https://gaftp.epa.gov
Click Show Certificate
Access Details
Find URL with *.crt extension Currently we bundle the pre-downloaded crt and its PEM (which is accepted in wget command) file in ./inst/extdata. The instruction above is for certificate updates in the future.
Author(s)
Insang Song
References
Omernik JM, Griffith GE (2014). “Ecoregions of the Conterminous United States: Evolution of a Hierarchical Spatial Framework.” Environmental Management, 54(6), 1249–1266. ISSN 0364-152X, 1432-1009, doi:10.1007/s00267-014-0364-1, https://link.springer.com/article/10.1007/s00267-014-0364-1.
Examples
## Not run:
download_ecoregion(
directory_to_save = tempdir(),
acknowledgement = TRUE,
download = FALSE, # NOTE: download skipped for examples,
remove_command = TRUE,
unzip = FALSE
)
## End(Not run)