The download_tri()
function accesses and downloads toxic release data from the U.S. Environmental Protection Agency's (EPA) Toxic Release Inventory (TRI) Program.
Usage
download_tri(
year = c(2018L, 2022L),
directory_to_save = NULL,
acknowledgement = FALSE,
download = FALSE,
remove_command = FALSE,
hash = FALSE
)
Arguments
- year
character(1 or 2). length of 4. Year or start/end years for downloading data.
- 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 settingTRUE
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.- hash
logical(1). By setting
TRUE
the function will return anrlang::hash_file()
hash character corresponding to the downloaded files. Default isFALSE
.
Value
For
hash = FALSE
, NULLFor
hash = TRUE
, anrlang::hash_file
character.Comma-separated value (CSV) files will be stored in
directory_to_save
.
Examples
if (FALSE) { # \dontrun{
download_tri(
year = 2021L,
directory_to_save = tempdir(),
acknowledgement = TRUE,
download = FALSE, # NOTE: download skipped for examples,
remove_command = TRUE
)
} # }