Merge the ref_species table to append new variables, names, or categories to x.
datLUTspp(
x = NULL,
uniquex = NULL,
NAclass = "Other",
group = FALSE,
states = NULL,
spcdname = "COMMON",
add0 = FALSE,
stopifmiss = FALSE,
xtxt = NULL,
dsn = NULL,
dbconn = NULL,
dbconnopen = FALSE,
dbwrite = FALSE,
dbreturn = TRUE,
overwrite = TRUE,
savedata = FALSE,
savedata_opts = NULL,
gui = FALSE
)
The input data table with look-up table variable(s).
Name of the new variable(s).
Look up table with categories.
If savedata = TRUE, a comma-delimited file is output to the outfolder as outfn. If outfn = NULL, the name of the file will be datlut_'date'.csv.
Data frame or comma-delimited file (*.csv). The data table with variable to classify.
String. Unique values of SPCD to match, if x is NULL.
String. NA values in xvar will be changed to NAclass.
Logical. If TRUE, the group variable in ref_species are merged to data table (E_SPGRPCD, W_SPGRPCD), depending on state(s) specified. If states overlap both E and W regions, the region with majority is used or E if equal. The group name is merged from ref_codes, SPGRPCD Variable.
String. Name of state(s) the x table is from.
String. Name for species output type ('COMMON', 'SCIENTIFIC', 'SYMBOL', 'COMMON_SCIENTIFIC').
Logical. IF TRUE, keep all codes in look up table. If FALSE, only include codes that are in x.
Logical. IF TRUE, stops function if missing codes in LUTx.
String.* Name of x table for more useful information in warnings.
String. Data source name of database with x.
Open database connection.
Logica. If TRUE, keep database connection open.
Logical. If TRUE, write class column to database table x.
Logical. If TRUE, return table with class column.
Logical. If TRUE, and the class name already exists in x, overwrites class name.
Logical. If TRUE, saves data to outfolder.
List. See help(savedata_options()) for a list of options. Only used when savedata = TRUE. If out_layer = NULL, default = 'datlut'.
Logical. If gui, user is prompted for parameters.
Tracey S. Frescino
WYtreelut <- datLUTspp(WYtree)
names(WYtreelut)
WYtree2 <- WYtreelut$xLUT
head(WYtree2)
Run the code above in your browser using DataLab