R/DBgetEvalid.R
DBgetEvalid.Rd
Extracts FIA EVALIDs for identifying an estimation group of plots. EVALIDs may be extracted by most current evaluation (evalCur=TRUE) or by the end year of an evaluation (evalEndyr) or all evaluations in the database for one or more states. See details for more information.
DBgetEvalid(
states = NULL,
RS = NULL,
datsource = "datamart",
data_dsn = NULL,
invtype = "ANNUAL",
evalCur = TRUE,
evalEndyr = NULL,
evalid = NULL,
evalAll = FALSE,
evalType = "VOL",
invyrtab = NULL,
dbTabs = dbTables(),
dbconn = NULL,
dbconnopen = FALSE,
returnPOP = FALSE,
gui = FALSE
)
String or numeric vector. Name (e.g., 'Arizona','New Mexico') or code (e.g., 4, 35) of state(s) for evalid. If all states in one or more FIA Research Station is desired, set states=NULL and use RS argument to define RS.
String vector. Name of research station(s) ('RMRS','SRS','NCRS','NERS','PNWRS'). Do not use if states is populated.
Source of data ('datamart', 'sqlite').
If datsource='sqlite', the file name (data source name) of the sqlite database (*.sqlite).
String. The type of FIA data to extract ('PERIODIC', 'ANNUAL'). Only 1 allowed at a time. See further details below.
Logical. If TRUE, the most current FIA Evaluation is extracted for state(s).
Number. The end year of the FIA Evaluation period of interest. Selects only sampled plots and conditions for the evaluation period. If more than one state, create a named list object with evalEndyr labeled for each state (e.g., list(Utah=2014, Colorado=2013).
Integer. One or more EVALID to check if exists.
Logical. If TRUE, gets all EVALIDs for invtype.
String vector. The type(s) of evaluation of interest ('ALL', 'CURR', 'VOL', 'GRM', 'P2VEG', 'DWM", 'INV', 'REGEN', 'CRWN'). The evalType 'ALL' includes nonsampled plots; 'CURR' includes plots used for area estimates; 'VOL' includes plots used for area and/or tree estimates; The evalType 'GRM' includes plots used for growth, removals, mortality, and change estimates (eval_typ are accepted. See details below and FIA database manual for regional availability and/or differences.
Data frame. A data frame including inventory years by state. If NULL, it is generated from SURVEY table from FIA database based on states and invtype.
List of database tables the user would like returned. See help(dbTables) for a list of options.
Open database connection.
Logical. If TRUE, the dbconn connection is not closed.
Logical. If TRUE, returns pop tables (SURVEY, POP_PLOT_STRATUM_ASSGN) as R objects instead of table names, if in db.
Logical. If TRUE, gui windows pop up for parameter selection.
A list of the following objects:
String vector. State names.
String vector. FIA research station names included in output.
Named list. evalid by state.
String. Inventory type for states(s) (ANNUAL/PERIODIC).
Data frame. Inventory years by state for evalidlist.
Named list. Evaluation type(s) by state.
Named list. Inventory years by state for evalidlist.
Data frame. If returnPOP=TRUE, the SURVEY table from FIADB.
FIA Evaluation
An Evaluation defines a group of plots in the FIA Database
used for state-level estimates, representing different spans of data and
different stratification and area adjustments. An Evaluation Type (evalType)
is used to identify a specific set of plots for a particular response to be
able to ensure a sample-based estimate for a population. See FIA's Database
documentation for current available Evaluation Types and descriptions
(https://www.fia.fs.fed.us/library/database-documentation/index.php).
EVALID
An EVALID is a unique code defining an Evaluation, generally in
the format of a 2-digit State code, a 2-digit year code, and a 2-digit
Evaluation Type code.
EVAL_TYP
EVALIDCD | EVAL_TYP | Description | |
00 | EXPALL | All area | |
01 | EXPVOL/EXPCURR | Area/Volume | |
03 | EXPCHNG/EXPGROW/EXPMORT/EXPREMV | Area Change/GRM | |
07 | EXPDWM | DWM | |
08 | EXPREGEN | Regeneration | |
09 | EXPINV | Invasive | |
10 | EXPP2VEG | Veg profile | |
12 | EXPCRWN | Crown |
FIA database tables used:
1. SURVEY - To get latest inventory year,
invyrtab = NULL
2. POP_EVAL - To get EVALID and EVALID years
if (FALSE) {
# Get evalid and inventory years for Wyoming
WYeval <- DBgetEvalid(states="Wyoming")
names(WYeval)
WYeval$evalidlist
WYeval$invtype
WYeval$invyrtab
WYeval$evalType
WYeval$invyrs
# Get evalid for Utah and Wyoming
DBgetEvalid(states=c("Wyoming", "Utah"))
# Get evalid for an FIA Research Station
RSevalid <- DBgetEvalid(RS="NERS")
names(RSevalid)
RSevalid$evalidlist
}