Function to specifically retrieve all NLCD metrics for a given year using the StreamCat API.
Usage
sc_nlcd(
year = "2019",
aoi = NULL,
comid = NULL,
state = NULL,
county = NULL,
region = NULL,
showAreaSqKm = NULL,
showPctFull = 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>
- 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 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
Examples
# \donttest{
df <- sc_nlcd(year='2001', aoi='catchment',comid='179,1337,1337420')
#> Rows: 3 Columns: 19
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (19): COMID, WSAREASQKM, CATAREASQKM, PCTHBWET2001CAT, PCTURBMD2001CAT, ...
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
df <- sc_nlcd(comid='1337420', year='2001', aoi='watershed', region='01')
#> Rows: 65969 Columns: 19
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (1): REGIONID
#> dbl (18): COMID, WSAREASQKM, PCTHBWET2001WS, PCTURBMD2001WS, PCTCONIF2001WS,...
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
df <- sc_nlcd(year='2001', aoi='watershed', region='01',
countOnly=TRUE)
#> Rows: 1 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (2): ROWCOUNT, COLUMNCOUNT
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
df <- sc_nlcd(year='2001', aoi='watershed', region='01',
showAreaSqKm=FALSE, showPctFull=TRUE)
#> Rows: 65968 Columns: 20
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (1): REGIONID
#> dbl (19): COMID, WSAREASQKM, PCTHBWET2001WS, PCTURBMD2001WS, PCTCONIF2001WS,...
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
df <- sc_nlcd(year='2001, 2006', aoi='catchment,watershed',
comid='179,1337,1337420')
#> Rows: 3 Columns: 67
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (67): COMID, WSAREASQKM, CATAREASQKM, PCTURBMD2001CAT, PCTURBMD2001WS, P...
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# }