| Type: | Package |
| Title: | 'StreamCatTools' |
| Version: | 0.11.0 |
| Description: | Tools for using the 'StreamCat' and 'LakeCat' API and interacting with the 'StreamCat' and 'LakeCat' database. Convenience functions in the package wrap the API for 'StreamCat' on https://api.epa.gov/StreamCat/streams/metrics. |
| Depends: | R (≥ 4.1.0) |
| Imports: | sf, nhdplusTools, jsonlite, httr2, curl (≥ 6.0.0), ggpattern, patchwork, cowplot, tigris, ggplot2, |
| Suggests: | dplyr, mapview, testthat, knitr, rmarkdown, devtools, xml2, magrittr, readr, tidyr, stringr, purrr, lifecycle, tidyselect, DBI, duckdb, tictoc, stats, wk |
| Encoding: | UTF-8 |
| URL: | https://usepa.github.io/StreamCatTools/, https://github.com/USEPA/StreamCatTools |
| BugReports: | https://github.com/USEPA/StreamCatTools/issues |
| VignetteBuilder: | knitr,rmarkdown |
| RoxygenNote: | 7.3.3 |
| License: | CC0 |
| NeedsCompilation: | no |
| Packaged: | 2026-05-14 21:41:57 UTC; mweber |
| Author: | Marc Weber [aut, cre], Ryan Hill [ctb], Selia Markley [ctb], Travis Hudson [ctb], Allen Brookes [ctb], David Rebhuhn [ctb], Michael Dumelle [ctb], Justin Bousquin [ctb], Zachary Smith [ctb] |
| Maintainer: | Marc Weber <weber.marc@epa.gov> |
| Repository: | CRAN |
| Date/Publication: | 2026-05-14 22:10:02 UTC |
Lookup Full Metric Name
Description
Function to retrieve a full metric name based on the short name using the LakeCat API.
Usage
lc_fullname(metric = NULL)
Arguments
metric |
Short metric name Syntax: metric=value1 Values: metric |
Value
A lookup of the full name for a given LakeCat metric
Author(s)
Marc Weber
Examples
fullname <- lc_fullname(metric='clay')
Get Lake COMIDs
Description
Function to return NHDPlusV2 Waterbody COMIDS using either a dataframe with coordinates and a specified CRS or an sf object. The function generates a vector of NHDPlus Waterbody COMID values a user can then pass to lc_get_data function
Usage
lc_get_comid(
dd = NULL,
xcoord = NULL,
ycoord = NULL,
crsys = NULL,
buffer = NULL
)
Arguments
dd |
Name of data frame object. Can be a simple data frame with coordinate columns in a known CRS or an sf points data frame |
xcoord |
The x coordinate column if using a raw data frame |
ycoord |
The y coordinate column if using a raw data frame |
crsys |
The epsg code if using a raw data frame |
buffer |
The amount of buffer to use to extend search for a waterbody (simply passed to nhdplusTools::get_waterbodies) |
Value
A new sf data frame with a populated 'COMID' column
Author(s)
Marc Weber
Examples
## Not run:
dd <- data.frame(x = c(-89.198,-114.125,-122.044),
y = c(45.502,47.877,43.730))
comids <- lc_get_comid(dd, xcoord='x',
ycoord='y', crsys=4269)
dd <- data.frame(x = c(-89.198,-114.125,-122.044),
y = c(45.502,47.877,43.730)) |>
sf::st_as_sf(coords = c('x', 'y'), crs = 4326)
comids <- lc_get_comid(dd)
## End(Not run)
Get LakeCat data
Description
Function to return LakeCat metrics using the StreamCat API. The function allows a user to get specific metric data aggregated by area of interest, returned by comid(s), hydroregion(s), state(s), or county(ies).
Usage
lc_get_data(
comid = NULL,
metric = NULL,
aoi = NULL,
showAreaSqKm = NULL,
showPctFull = NULL,
state = NULL,
county = NULL,
region = NULL,
conus = NULL,
countOnly = NULL
)
Arguments
comid |
Return metric information for specific COMIDs. Can be a comma-delimited list, a character vector,
or any object that can be coerced to a comma-delimited list with |
metric |
Name(s) of metrics to query. Must be character string with comma-delimited list of metrics. Not case-sensitive. Syntax: name=<name1>,<name2> |
aoi |
Specify the area of interest described by a metric. By default, all available areas of interest for a given metric are returned. Case-sensitive. Syntax: areaOfInterest=<value1>,<value2> Values: catchment|watershed| |
showAreaSqKm |
Return the area in square kilometers of a given area of interest. The default value is false. Values: true|false |
showPctFull |
Return the pctfull for each dataset. The default value is false. Values: true|false |
state |
Return metric information for COMIDs within a specific state. Use a state's abbreviation to
query for a given state. One of |
county |
Return metric information for COMIDs within a specific county.
Users must use the FIPS code, not county name, as a way to disambiguate counties.
One of |
region |
Return metric information for COMIDs within a specified hydroregion.
Hydroregions are specified using full name i.e. |
conus |
Return all COMIDs in the conterminous United States. Character string (Not case-sensitive) or logical.
The default value is false. If true, |
countOnly |
Return a CSV containing only the row count (ROWCOUNT) and the column count (COLUMNCOUNT) that the server expects to return in a request. The default value is false. Values: true|false |
Value
A tibble of desired StreamCat metrics. If data are missing for all rows of a given metric, then the column for that metric will not exist. If data are missing for only some rows, then they will be specified with NA.
Author(s)
Marc Weber
Examples
## Not run:
df <- lc_get_data(comid='23794487', aoi='cat', metric='fert')
df <- lc_get_data(metric='pcturbmd2006', aoi='ws',
comid='24083377')
df <- lc_get_data(metric='pctgrs2006', aoi='ws', region='Region01')
df <- lc_get_data(metric='pctwdwet2006', aoi='ws', county='41003')
df <- lc_get_data(metric='pcturbmd2006', aoi='ws',
comid='24083377', showAreaSqKm=FALSE, showPctFull=TRUE)
df <- lc_get_data(metric='pcturbmd2006,damdens',
aoi='cat,ws', comid='23783629,23794487,23812618')
df <- lc_get_data(metric='pcturbmd2006,damdens',
aoi='cat,ws', comid=c('23783629','23794487','23812618'))
df <- lc_get_data(metric='pcturbmd2006,damdens',
aoi='cat,ws', comid='23783629,23794487,23812618',
countOnly=TRUE)
## End(Not run)
Get LakeCat Metric Names
Description
Function to filter LakeCat metrics metrics by category, area of interest, dataset or year. Use 'lc_get_params(categories)' or 'lc_get_params(datasets)' to see all the valid category or dataset options
Usage
lc_get_metric_names(category = NULL, aoi = NULL, year = NULL, dataset = NULL)
Arguments
category |
Filter LakeCat metrics based on the metric category |
aoi |
Filter LakeCat metrics based on the area of interest |
year |
Filter LakeCat metrics based on a particular year or years |
dataset |
Filter LakeCat metrics based on the dataset name |
Value
A dataframe of merics and description that match filter criteria
Author(s)
Marc Weber
Examples
## Not run:
metrics <- lc_get_metric_names(category='Natural')
metrics <- lc_get_metric_names(category = c('Anthropogenic','Natural'),
aoi=c('Cat','Ws'))
## End(Not run)
Get NLCD Data
Description
'r lifecycle::badge("deprecated")' 'lc_nlcd()' was renamed to 'lc_get_nlcd()' to create a more consistent API. Function to specifically retrieve all NLCD metrics for a given year using the StreamCat API.
Usage
lc_get_nlcd(
year = "2019",
comid = NULL,
aoi = NULL,
showAreaSqKm = NULL,
showPctFull = NULL,
state = NULL,
county = NULL,
region = NULL,
conus = NULL,
countOnly = NULL
)
Arguments
year |
Years(s) of NLCD metrics to query. Only valid NLCD years are accepted (i.e. 2001, 2004, 2006, 2008, 2011, 2013, 2016, 2019) Syntax: year=<year1>,<year2> |
comid |
Return metric information for specific COMIDs Syntax: comid=<comid1>,<comid2> |
aoi |
Specify the area of interest described by a metric. By default, all available areas of interest for a given metric are returned. Syntax: areaOfInterest=<value1>,<value2> Values: catchment|watershed|riparian_catchment|riparian_watershed|other |
showAreaSqKm |
Return the area in square kilometers of a given area of interest. The default value is false. Values: true|false |
showPctFull |
Return the pctfull for each dataset. The default value is false. Values: true|false |
state |
Return metric information for COMIDs within a specific state. Use a state's abbreviation to query for a given state. Syntax: state=<state1>,<state2> |
county |
Return metric information for COMIDs within a specific county. Users must use the FIPS code, not county name, as a way to disambiguate counties. Syntax: county=<county1>,<county1> |
region |
Return metric information for COMIDs within a specified hydroregion. Syntax: region=<regionid1>,<regionid2> |
conus |
Return all COMIDs in the conterminous United States. The default value is false. Values: true|false |
countOnly |
Return a CSV containing only the row count (ROWCOUNT) and the column count (COLUMNCOUNT) that the server expects to return in a request. The default value is false. Values: true|false |
Value
A tibble of desired StreamCat metrics
Author(s)
Marc Weber
Examples
## Not run:
df <- lc_get_nlcd(comid='23783629', year='2019', aoi='ws') # Will show a deprecation warning
df <- lc_get_nlcd(comid='23783629', year='2019', aoi='ws')
df <- lc_get_nlcd(year='2016', aoi='cat',
comid='23783629,23794487,23812618', showAreaSqKm=FALSE, showPctFull=TRUE)
df <- lc_get_nlcd(year='2016', aoi='cat',
comid='23783629,23794487,23812618', countOnly=TRUE)
df <- lc_get_nlcd(year='2016, 2019', aoi='cat,ws',
comid='23783629,23794487,23812618')
## End(Not run)
Get NNI
Description
Function to get all NNI data available for a given year.
Usage
lc_get_nni(
year,
aoi = NULL,
comid = NULL,
showAreaSqKm = TRUE,
showPctFull = NULL,
countOnly = NULL
)
Arguments
year |
Years(s) of NNI metrics to query. Only valid NNI years are accepted (1987:2017) Syntax: year=<year1>,<year2> |
aoi |
Specify the area of interest described by a metric. By default, all available areas of interest for a given metric are returned. Syntax: areaOfInterest=<value1>,<value2> Values: catchment|watershed |
comid |
Return metric information for specific COMIDs Syntax: comid=<comid1>,<comid2> |
showAreaSqKm |
Return the area in square kilometers of a given area of interest. The default value is true. Values: true|false |
showPctFull |
Return the pctfull for each dataset. The default value is false. Values: true|false |
countOnly |
Return a CSV containing only the row count (ROWCOUNT) and the column count (COLUMNCOUNT) that the server expects to return in a request. The default value is false. Values: true|false |
Value
A tibble of desired StreamCat metrics
Author(s)
Selia Markley
Examples
df <- lc_get_nni(year='1987, 1990, 2005, 2017', aoi='cat,ws',
comid='23783629,23794487,23812618')
df <- lc_get_nni(year='2015', aoi='cat',
comid='23783629', countOnly=TRUE)
df <- lc_get_nni(comid='23783629', year='2011, 2012', aoi='ws')
Get LakeCat Parameters
Description
Function to return available LakeCat parameters using the StreamCat API.
Usage
lc_get_params(param = NULL)
Arguments
param |
List of available parameters in the API for the following options: name, areaofInterest, region, state, county. State and county return a data frame that includes FIPS codes, names and state abbreviations Syntax: param=<value1>,<value2> Values: name|area |
Value
A list of all the current LakeCat values for a given parameter
Author(s)
Marc Weber
Examples
## Not run:
params <- lc_get_params(param='variable_info')
params <- lc_get_params(param='metric_names')
params <- sc_get_params(param='categories')
params <- lc_get_params(param='aoi')
params <- lc_get_params(param='state')
params <- lc_get_params(param='county')
params <- sc_get_params(param='datasets')
## End(Not run)
Get LakeCat Lake Watershed
Description
Lookup function for a single COMID from S3 GeoParquet (optionally restricted to one HUC2). Queries one COMID from an S3-hosted, HUC2-partitioned GeoParquet dataset and returns an sf object. If 'huc2' is provided, only that partition is scanned (fastest). If not, the function tries a glob over all HUC2 partitions and falls back to a shallower pattern if needed. The function: - loads DuckDB httpfs (S3) extension, - pushes an equality filter on 'COMID' for row-group/file pruning, - converts WKB geometry to sf with the CRS you provide (default EPSG:4326).
Usage
lc_get_watershed(
comid,
huc2 = NA_character_,
huc2_filter = NULL,
bucket = "dmap-data-commons-ow",
prefix = "data/streamcat/LakeCatWatersheds/",
region = "us-east-1",
install_missing = FALSE,
keep_open = FALSE,
verbose = TRUE,
progress = TRUE,
threads = 4,
enable_object_cache = TRUE,
skip_describe = FALSE,
skip_counts = TRUE,
sf_crs = 4326,
retries = 5,
retry_base_delay = 0.5,
retry_max_delay = 8,
url_style = c("path", "virtual_hosted"),
s3_endpoint = NULL
)
Arguments
comid |
Scalar COMID to query (numeric or character, required). |
huc2 |
Optional two-digit HUC2 string (e.g., "01") to restrict search to one partition. |
huc2_filter |
Optional character vector of HUC2s to read (e.g., c("01","05")) for multi-partition pruning. |
bucket |
Character(1). S3 bucket (default "dmap-data-commons-ow"). |
prefix |
Character(1). S3 prefix under the bucket (default "data/streamcat/LakeCatWatersheds/"). |
region |
Character(1). S3 region (default "us-east-1"). |
install_missing |
Logical. Install missing packages (duckdb, DBI, sf, wk) if needed (default FALSE). |
keep_open |
Logical. Keep the DuckDB connection open (default FALSE). Note: the connection is not returned. |
verbose |
Logical. Print progress messages (default TRUE). |
progress |
Logical. Show a simple progress bar (default TRUE). |
threads |
Integer or NULL. If set, 'PRAGMA threads' for DuckDB (parallelism). |
enable_object_cache |
Logical. Enable DuckDB object cache to speed repeated queries (default TRUE). |
skip_describe |
Logical. Skip DESCRIBE step (default FALSE). |
skip_counts |
Logical. Skip HUC2 counts step (default TRUE; no longer returned). |
sf_crs |
Integer or character. CRS for the output sf object (default 4326). |
retries |
Integer. Number of retries for transient S3/HTTP errors (default 5). |
retry_base_delay |
Numeric. Initial exponential backoff delay in seconds (default 0.5). |
retry_max_delay |
Numeric. Maximum backoff delay per attempt in seconds (default 8). |
url_style |
Character. S3 URL style used by DuckDB httpfs, one of "path" or "virtual_hosted". Passed to 'match.arg()', default "path". |
s3_endpoint |
Optional character(1). Custom S3 endpoint hostname (e.g., "s3.amazonaws.com"). NULL uses the default for the selected region. |
Value
An sf object with zero or one+ rows (if multiple features share the same COMID).
Plot National Nutrient Inventory data for lakes
Description
Function to plot time series of nitrogen and phosphorus budgets for a given lake COMID. This function allows a user to return a time series of major inputs, outputs, and derived metrics of nitrogen and phosphorus. Plot is returned as an object
Usage
lc_plotnni(comid, include.nue = FALSE)
Arguments
comid |
Identifier of lake COMID user wants to plot NNI data for. Must be a character string with the COMID digit. Syntax: com=<COMID> |
include.nue |
Include time series of nitrogen use efficiency in the returned plot. The default value is false. Values: true|false |
Value
Return plot as an object.
Author(s)
Selia Markley
Examples
## Not run:
p <- lc_plotnni(comid='23794487')
p <- lc_plotnni(comid='23794487', include.nue=TRUE)
## End(Not run)
Lookup Full Metric Name
Description
Function to retrieve a full metric name based on the short name using the StreamCat API.
Usage
sc_fullname(metric = NULL)
Arguments
metric |
Short metric name Syntax: metric=value1 Values: metric |
Value
A lookup of the full name for a given StreamCat metric
Author(s)
Marc Weber
Examples
fullname <- sc_fullname(metric='clay')
Get COMIDs
Description
Function to return NHDPlusV2 COMIDS using either a dataframe with coordinates and a specified CRS or an sf object. The function generates a vector of COMID values a user can then pass to sc_get_data function
Usage
sc_get_comid(dd = NULL, xcoord = NULL, ycoord = NULL, crsys = NULL)
Arguments
dd |
Name of data frame object. Can be a simple data frame with coordinate columns in a known CRS or an sf points data frame |
xcoord |
The x coordinate column if using a raw data frame |
ycoord |
The y coordinate column if using a raw data frame |
crsys |
The epsg code if using a raw data frame |
Value
A new sf data frame with a populated 'COMID' column
Author(s)
Marc Weber
Examples
## Not run:
dd <- data.frame(x = c(-122.649,-100.348,-75.186,-106.675),
y = c(45.085, 35.405,42.403,38.721))
comids <- sc_get_comid(dd, xcoord='x',
ycoord='y', crsys=4269)
dd <- sf::st_point_on_surface(sf::read_sf(system.file("shape/nc.shp", package="sf")))
comids <- sc_get_comid(dd)
comids <- sc_get_comid(dd, xcoord='x',
ycoord='y', crsys=4269)
dd <- sf::read_sf(system.file("shape/nc.shp", package="sf"))
comids <- sc_get_comid(dd)
## End(Not run)
Get StreamCat data
Description
Function to return StreamCat catchment and watershed metrics using the StreamCat API. The function allows a user to get specific metric data aggregated by area of interest, returned by comid(s), hydroregion(s), state(s), or county(ies).
Usage
sc_get_data(
comid = NULL,
metric = NULL,
aoi = NULL,
showAreaSqKm = NULL,
showPctFull = NULL,
state = NULL,
county = NULL,
region = NULL,
conus = NULL,
countOnly = NULL
)
Arguments
comid |
Return metric information for specific COMIDs. Can be a comma-delimited list, a character vector,
or any object that can be coerced to a comma-delimited list with |
metric |
Name(s) of metrics to query. Must be character string with comma-delimited list of metrics,
or, if |
aoi |
Name(s) of areas of interest to query.
If a metric does not have data for a given AOI, no data is returned for that AOI.
Certain metrics that have no AOI specified for StreamCat need the AOI to be specified as Syntax: areaOfInterest=<value1>,<value2> Values: cat|ws|catrp100|wsrp100|other |
showAreaSqKm |
Return the area in square kilometers of a given area of interest. The default value is false. Values: true|false |
showPctFull |
Return the pctfull for each dataset. The default value is false. Values: true|false |
state |
Return metric information for COMIDs within a specific state. Use a state's abbreviation to
query for a given state. One of |
county |
Return metric information for COMIDs within a specific county.
Users must use the FIPS code, not county name, as a way to disambiguate counties.
One of |
region |
Return metric information for COMIDs within a specified hydroregion.
Hydroregions are specified using full name i.e. |
conus |
Return all COMIDs in the conterminous United States. Character string (Not case-sensitive) or logical.
The default value is false. If true, |
countOnly |
Return a CSV containing only the row count (ROWCOUNT) and the column count (COLUMNCOUNT) that the server expects to return in a request. The default value is false. Values: true|false |
Value
A data frame of StreamCat metrics. If data are missing for all rows of a given metric, then the column for that metric will not exist. If data are missing for only some rows, then they will be specified with NA.
Author(s)
Marc Weber
Examples
## Not run:
df <- sc_get_data(comid='179', aoi='cat', metric='fert')
df <- sc_get_data(metric='pctgrs2006', aoi='ws', region='Region01')
df <- sc_get_data(metric='pctwdwet2006', aoi='ws', county='41003')
df <- sc_get_data(metric='pcturbmd2006', aoi='ws,rp100',
comid='1337420')
df <- sc_get_data(metric='pcturbmd2006,damdens',
aoi='cat,ws', comid='179,1337,1337420')
df <- sc_get_data(metric='pcturbmd2006,damdens',
aoi='cat,ws', comid='179,1337,1337420',
showAreaSqKm='true', showPctFull='true')
df <- sc_get_data(metric='pcturbmd2006,damdens',
aoi='cat,ws', comid='179,1337,1337420', countOnly='true')
df <- sc_get_data(metric='thalwagdepth', comid='179,1337,1337420', aoi='other')
df <- sc_get_data(metric='thalwagdepth', comid=c('179','1337','1337420'), aoi='other')
df <- sc_get_data(comid='179', aoi='ws', metric='all')
## End(Not run)
Get StreamCat Metric Names
Description
Function to filter StreamCat metrics metrics by category, area of interest, dataset or year. Use 'sc_get_params(categories)' or 'sc_get_params(datasets)' to see all the valid category or dataset options
Usage
sc_get_metric_names(category = NULL, aoi = NULL, year = NULL, dataset = NULL)
Arguments
category |
Filter StreamCat metrics based on the metric category |
aoi |
Filter StreamCat metrics based on the area of interest |
year |
Filter StreamCat metrics based on a particular year or years |
dataset |
Filter StreamCat metrics based on the dataset name |
Value
A dataframe of merics and description that match filter criteria
Author(s)
Marc Weber
Examples
## Not run:
metrics <- sc_get_metric_names(category='Wildfire')
metrics <- sc_get_metric_names(category = c('Deposition','Climate'),
aoi=c('Cat','Ws'))
metrics <- sc_get_metric_names(aoi='Other',
dataset=c('Canal Density','Predicted Channel Widths Depths'))
## End(Not run)
Get NLCD Data
Description
'r lifecycle::badge("deprecated")' 'sc_nlcd()' was renamed to 'sc_get_nlcd()' to create a more consistent API. Function to retrieve all NLCD metrics for a given year using the StreamCat API.
Usage
sc_get_nlcd(
year = "2019",
comid = NULL,
aoi = NULL,
showAreaSqKm = NULL,
showPctFull = NULL,
state = NULL,
county = NULL,
region = NULL,
conus = NULL,
countOnly = NULL
)
sc_nlcd(
year = "2019",
comid = NULL,
aoi = NULL,
showAreaSqKm = NULL,
showPctFull = NULL,
state = NULL,
county = NULL,
region = NULL,
conus = NULL,
countOnly = NULL
)
Arguments
year |
Years(s) of NLCD metrics to query. Only valid NLCD years are accepted (i.e. 2001, 2004, 2006, 2008, 2011, 2013, 2016, 2019) Syntax: year=<year1>,<year2> |
comid |
Return metric information for specific COMIDs Syntax: comid=<comid1>,<comid2> |
aoi |
Specify the area of interest described by a metric. By default, all available areas of interest for a given metric are returned. Syntax: areaOfInterest=<value1>,<value2> Values: catchment|watershed|riparian_catchment|riparian_watershed|other |
showAreaSqKm |
Return the area in square kilometers of a given area of interest. The default value is false. Values: true|false |
showPctFull |
Return the pctfull for each dataset. The default value is false. Values: true|false |
state |
Return metric information for COMIDs within a specific state. Use a state's abbreviation to query for a given state. Syntax: state=<state1>,<state2> |
county |
Return metric information for COMIDs within a specific county. Users must use the FIPS code, not county name, as a way to disambiguate counties. Syntax: county=<county1>,<county1> |
region |
Return metric information for COMIDs within a specified hydroregion. Syntax: region=<regionid1>,<regionid2> |
conus |
Return all COMIDs in the conterminous United States. The default value is false. Values: true|false |
countOnly |
Return a CSV containing only the row count (ROWCOUNT) and the column count (COLUMNCOUNT) that the server expects to return in a request. The default value is false. Values: true|false |
Value
A tibble of desired StreamCat metrics
Author(s)
Marc Weber
Examples
## Not run:
df <- sc_get_nlcd(year='2001', aoi='cat',comid='179') # Will show a deprecation warning
df <- sc_get_nlcd(year='2001', aoi='cat',comid='179,1337,1337420')
df <- sc_get_nlcd(year='2001', aoi='ws', region='Region01')
df <- sc_get_nlcd(year='2001', aoi='ws', region='Region01',
countOnly=TRUE)
df <- sc_get_nlcd(year='2001', aoi='ws', region='Region01',
showAreaSqKm=FALSE, showPctFull=TRUE)
df <- sc_get_nlcd(year='2001, 2006', aoi='cat,ws',
comid='179,1337,1337420')
## End(Not run)
Get NNI
Description
Function to get all NNI data available for a given year.
Usage
sc_get_nni(
year,
aoi = NULL,
comid = NULL,
showAreaSqKm = TRUE,
state = NULL,
county = NULL,
region = NULL,
conus = NULL,
showPctFull = NULL,
countOnly = NULL
)
Arguments
year |
Years(s) of NNI metrics to query. Only valid NNI years are accepted (1987:2017) Syntax: year=<year1>,<year2> |
aoi |
Specify the area of interest described by a metric. By default, all available areas of interest for a given metric are returned. Syntax: areaOfInterest=<value1>,<value2> Values: catchment|watershed |
comid |
Return metric information for specific COMIDs Syntax: comid=<comid1>,<comid2> |
showAreaSqKm |
Return the area in square kilometers of a given area of interest. The default value is true. Values: true|false |
state |
Return metric information for COMIDs within a specific state. Use a state's abbreviation to query for a given state. Syntax: state=<state1>,<state2> |
county |
Return metric information for COMIDs within a specific county. Users must use the FIPS code, not county name, as a way to disambiguate counties. Syntax: county=<county1>,<county1> |
region |
Return metric information for COMIDs within a specified hydroregion. Syntax: region=<regionid1>,<regionid2> |
conus |
Return all COMIDs in the conterminous United States. The default value is false. Values: true|false |
showPctFull |
Return the pctfull for each dataset. The default value is false. Values: true|false |
countOnly |
Return a CSV containing only the row count (ROWCOUNT) and the column count (COLUMNCOUNT) that the server expects to return in a request. The default value is false. Values: true|false |
Value
A tibble of desired StreamCat metrics
Author(s)
Selia Markley
Examples
## Not run:
df <- sc_get_nni(year='1987, 1990, 2005, 2017', aoi='cat,ws',
comid='179,1337,1337420')
df <- sc_get_nni(year='2015', aoi='cat',
comid='179', countOnly=TRUE)
df <- sc_get_nni(comid='179', year='2011, 2012', aoi='ws')
df <- sc_get_nni(year='2015, 2016, 2017', county='41003', aoi='ws')
## End(Not run)
Get StreamCat Parameters
Description
Function to return available StreamCat parameters using the StreamCat API.
Usage
sc_get_params(param = NULL)
Arguments
param |
List of available parameters in the API for the following options: name, areaofInterest, region, state, county. State and county return a data frame that includes FIPS codes, names and state abbreviations Syntax: param=<value1>,<value2> Values: name|area |
Value
A list of all the current StreamCat values for a given parameter
Author(s)
Marc Weber
Examples
## Not run:
params <- sc_get_params(param='variable_info')
params <- sc_get_params(param='metric_names')
params <- sc_get_params(param='categories')
params <- sc_get_params(param='aoi')
params <- sc_get_params(param='state')
params <- sc_get_params(param='county')
params <- sc_get_params(param='datasets')
## End(Not run)
Plot National Nutrient Inventory data for streams
Description
Function to plot time series of nitrogen and phosphorus budgets for a given stream COMID. This function allows a user to return a time series of major inputs, outputs, and derived metrics of nitrogen and phosphorus. Plot is returned as an object
Usage
sc_plotnni(comid, include.nue = FALSE, include.inset = TRUE)
Arguments
comid |
Identifier of stream COMID user wants to plot NNI data for. Must be a character string with the COMID digit. Syntax: com=<COMID> |
include.nue |
Include time series of nitrogen use efficiency in the returned plot. The default value is false. Values: true|false |
include.inset |
Include inset map that shows the location of the COMID and its basin. The default value is true. Values: true|false |
Value
Return plot as an object.
Author(s)
Selia Markley
Examples
## Not run:
p <- sc_plotnni(comid='1337420')
p <- sc_plotnni(comid='1337420', include.nue=TRUE)
p <- sc_plotnni(comid='1337420', include.inset=FALSE)
## End(Not run)