Skip to contents

Function to specifically retrieve all NLCD metrics for a given year using the StreamCat API.

Usage

lc_nlcd(
  year = "2019",
  aoi = NULL,
  comid = NULL,
  showAreaSqKm = NULL,
  showPctFull = 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>

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

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

Marc Weber

Examples

# \donttest{

df <- lc_nlcd(comid='23783629', year='2019', aoi='watershed')
#> Rows: 1 Columns: 18
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (18): COMID, WSAREASQKM, PCTURBOP2019WS, PCTSHRB2019WS, PCTOW2019WS, PCT...
#> 
#>  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 <- lc_nlcd(year='2016', aoi='catchment',
comid='23783629,23794487,23812618', showAreaSqKm=FALSE, showPctFull=TRUE)
#> Rows: 3 Columns: 19
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (19): COMID, WSAREASQKM, PCTSHRB2016CAT, PCTURBOP2016CAT, PCTHBWET2016CA...
#> 
#>  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 <- lc_nlcd(year='2016', aoi='catchment',
comid='23783629,23794487,23812618', 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 <- lc_nlcd(year='2016, 2019', aoi='catchment,watershed',
comid='23783629,23794487,23812618')
#> Rows: 3 Columns: 67
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> dbl (67): COMID, WSAREASQKM, CATAREASQKM, PCTHBWET2016CAT, PCTHBWET2016WS, 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.
# }