View source: R/nsink_prep_data.R
nsink_prep_data | R Documentation |
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.
nsink_prep_data(
huc,
projection,
data_dir = normalizePath("nsink_data/", winslash = "/", mustWork = FALSE),
year = "2016"
)
huc |
A character string of the HUC12 ID. Use
|
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 |
year |
The year of the nlcd and impervious data that was retrieved with
FedData's, |
returns a list of sf, raster, or tabular objects for each of the required datasets plus the huc.
## Not run:
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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.