Learn R Programming

amadeus (version 1.2.3)

download_ecoregion: 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
)

Value

  • For hash = FALSE, NULL

  • For hash = TRUE, an rlang::hash_file character.

  • Zip and/or data files will be downloaded and stored in directory_to_save.

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 TRUE the user acknowledges that the data downloaded using this function may be very large and use lots of machine storage and memory.

download

logical(1). FALSE will generate a *.txt file containing all download commands. By setting TRUE the function will download all of the requested data files.

remove_command

logical(1). Remove (TRUE) or keep (FALSE) the text file containing download commands.

unzip

logical(1). Unzip zip files. Default TRUE.

remove_zip

logical(1). Remove zip file from directory_to_download. Default FALSE.

hash

logical(1). By setting TRUE the function will return an rlang::hash_file() hash character corresponding to the downloaded files. Default is FALSE.

Author

Insang Song

References

article_omernik2014ecoregionsamadeus

Examples

Run this code
if (FALSE) {
download_ecoregion(
  directory_to_save = tempdir(),
  acknowledgement = TRUE,
  download = FALSE, # NOTE: download skipped for examples,
  remove_command = TRUE,
  unzip = FALSE
)
}

Run the code above in your browser using DataLab