Learn R Programming

StreamCatTools (version 0.10.0)

lc_get_nlcd: 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
)

lc_nlcd( year = "2019", comid = NULL, aoi = NULL, showAreaSqKm = NULL, showPctFull = NULL, state = NULL, county = NULL, region = NULL, conus = NULL, countOnly = NULL )

Value

A tibble of desired StreamCat metrics

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

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

Author

Marc Weber

Examples

Run this code
if (FALSE) {

df <- lc_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')
}

Run the code above in your browser using DataLab