Learn R Programming

rFIA (version 1.1.1)

clipFIA: Spatial and temporal queries for FIADB

Description

Performs space-time queries on Forest Inventory and Analysis Database (FIADB). Subset database to include only data associated with particular inventory years (i.e., most recent), and/or only data within a user-defined region.

Usage

clipFIA(db, mostRecent = TRUE, mask = NULL, matchEval = FALSE,
        evalid = NULL, designCD = NULL, nCores = 1)

Value

List object containing spatially intersected FIADB tables.

Arguments

db

FIA.Database or Remote.FIA.Database object produced from readFIA or getFIA. If a Remote.FIA.Database, data will be read in and processed state-by-state to conserve RAM (see details for an example).

mostRecent

logical; if TRUE, returns only data for most recent inventory.

mask

sp or sf Polygon/MultiPolgyon object; defines the boundaries of spatial intersection with FIA tables.

matchEval

logical; if TRUE, returns subset of data for which there are matching reporting years across states. Only useful if db contains mulitple state subsets of the FIA database.

evalid

character; unique value which identifies an inventory year and inventory type for a state. If you would like to subset data for an inventory year other than the most recent, use findEVALID to look locate this value (see Examples below).

designCD

character vector; plot designs to include. Default includes standard national plot design with other similar sampling designs. See FIA Database User Guide Appendix 1 for descriptions of plot designs (see References).

nCores

numeric; number of cores to use for parallel implementation. Check available cores using detectCores. Default = 1, serial processing.

Author

Hunter Stanke and Andrew Finley

Details

Not required to run other rFIA functions, but may help conserve free memory and reduce processing time if user is interested in producing estimates for a specific inventory year or within a region not explicitly described in the database (w/in user defined polygons).

Spatial intersections do not adhere strictly to absolute plot locations, all plots which fall within an estimation unit (often a county) which intersects with a user defined region will be returned. The plots which fall slightly outside of the region do NOT bias estimates (removed from computations), but as FIA often employs stratified random sampling estimators, all plots within intersecting estimation units must be present to proudce unbiased variance estimates.

If specifying spatio-temporal intersections on a "Remote.FIA.Database", evaluation will occur state-by-state once called by an estimator function.

References

FIA Database User Guide: https://research.fs.usda.gov/understory/forest-inventory-and-analysis-database-user-guide-nfi

See Also

findEVALID

Examples

Run this code
# \dontshow{
  # Restrict threads for CRAN compliance
  dt_threads <- data.table::getDTthreads()
  data.table::setDTthreads(1)
# }
## Load data from rFIA package
data(fiaRI)

## Most recent inventory
clipFIA(fiaRI, mostRecent = TRUE)

# \donttest{
## Only plots w/in estimation units w/in a user defined polygon
clipFIA(fiaRI, mask = countiesRI[1,], mostRecent = FALSE)
# }
# \dontshow{
  # Restore thread setting
  data.table::setDTthreads(dt_threads)
# }

Run the code above in your browser using DataLab