Learn R Programming

amadeus (version 1.2.2)

download_huc: Download National Hydrography Dataset (NHD) data

Description

NHDPlus data provides the most comprehensive and high-resolution hydrography data. This function downloads national dataset from NHDPlus Version 2.1 on USGS Amazon S3 storage.

Usage

download_huc(
  region = c("Lower48", "Islands"),
  type = c("Seamless", "OceanCatchment"),
  directory_to_save = NULL,
  acknowledgement = FALSE,
  download = FALSE,
  remove_command = FALSE,
  unzip = FALSE,
  hash = FALSE
)

Value

  • For hash = FALSE, NULL

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

  • Downloaded files will be stored in directory_to_save.

Arguments

region

character(1). One of c("Lower48", "Islands"). When "Islands" is selected, the data will be downloaded for Hawaii, Puerto Rico, and Virgin Islands.

type

character(1). One of c("Seamless", "OceanCatchment").

directory_to_save

character(1). Directory to download 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 the downloaded compressed files. Default is FALSE. Not working for this function since HUC data is in 7z format.

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

data_usgs2023nhdamadeus

Examples

Run this code
if (FALSE) {
download_huc(
  region = "Lower48",
  type = "Seamless",
  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