In addition to having local access to the required dataset, those datasets need to have some preparation. This function standardizes projections and extents and clips all datasets to the boundary of the specified HUC. Additionally, any tabular datasets (e.g. flow, time of travel, etc.) are included in the output as well.
Usage
nsink_prep_data(
huc,
projection,
data_dir = normalizePath("nsink_data/", winslash = "/", mustWork = FALSE),
year = "2016"
)
Arguments
- huc
A character string of the HUC12 ID. Use
nsink_get_huc_id
to look up ID by name.- projection
CRS to use, passed as ethier EPSG code (as numeric) or WKT (as character). This must be a projected CRS and not geographic as many of the measurements required for the nsink analysis require reliable length and area measurments.
- data_dir
Base directory that contains N-Sink data folders. Data may be downloaded with the
nsink_get_data
function.- year
The year of the nlcd and impervious data that was retrieved with FedData's,
get_nlcd
function.
Value
returns a list of sf, raster, or tabular objects for each of the required datasets plus the huc.
Examples
if (FALSE) {
library(nsink)
aea <- 5072
niantic_huc <- nsink_get_huc_id("Niantic River")$huc_12
niantic_nsink_data <- nsink_prep_data(huc = niantic_huc, projection = aea,
data_dir = "nsink_data")
# Example using EPSG code for projection
epsg <- 3748L
niantic_nsink_data <- nsink_prep_data(huc = niantic_huc, projection = epsg,
data_dir = "nsink_data")
}