sc_get_data | R Documentation |
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).
sc_get_data(
metric = NA,
aoi = NA,
comid = NA,
state = NA,
county = NA,
region = NA,
showAreaSqKm = NA,
showPctFull = NA,
conus = NA,
countOnly = NA
)
metric |
Name(s) of metrics to query 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. Syntax: areaOfInterest=<value1>,<value2> Values: catchment|watershed|riparian_catchment|riparian_watershed|other |
comid |
Return metric information for specific COMIDs. Needs to be a character string and function will convert to this format if needed. Syntax: comid=<comid1>,<comid2> |
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> |
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 |
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 |
A tibble of desired StreamCat metrics
Marc Weber
df <- sc_get_data(comid='179', aoi='catchment', metric='fert')
df <- sc_get_data(metric='PctGrs2006', aoi='watershed', region='01')
df <- sc_get_data(metric='PctUrbMd2006', aoi='riparian_catchment',
comid='1337420')
df <- sc_get_data(metric='PctUrbMd2006,DamDens',
aoi='catchment,watershed', comid='179,1337,1337420')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.