Type: | Package |
Title: | Utility Functions for Forest Inventory Estimation and Analysis |
Version: | 1.3.2 |
Date: | 2025-07-17 |
Description: | A set of tools for data wrangling, spatial data analysis, statistical modeling (including direct, model-assisted, photo-based, and small area tools), and USDA Forest Service data base tools. These tools are aimed to help Foresters, Analysts, and Scientists extract and perform analyses on USDA Forest Service data. |
Depends: | R (≥ 4.2.0) |
Imports: | data.table, DBI, gdalraster, graphics, hbsae, JoSAE, mase, methods, nlme, Rcpp, RColorBrewer, RPostgres, RSQLite, sae, sf, sqldf, stats, terra, units, utils |
Suggests: | knitr |
License: | GPL-3 |
Copyright: | See file COPYRIGHTS for details. |
URL: | https://github.com/USDAForestService/FIESTAutils |
BugReports: | https://github.com/USDAForestService/FIESTAutils/issues |
Encoding: | UTF-8 |
LazyData: | true |
LinkingTo: | Rcpp |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | yes |
Packaged: | 2025-07-17 18:59:53 UTC; tfrescino |
Author: | Tracey Frescino [aut], Chris Toney [aut], Grayson White [aut, cre], Joshua Yamamoto [aut] |
Maintainer: | Grayson White <graysonwhite13@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-07-17 22:10:02 UTC |
Updates reference tables
Description
Updates reference tables
Usage
.update_refs(write = FALSE)
Arguments
write |
Logical. Should the internal reference tables be overwritten? |
Value
No return value. Called for side effects.
Author(s)
Josh Yamamoto
Database - Test a PostgreSQL database.
Description
Checks a PostgreSQL database.
Usage
DBtestPostgreSQL(
dbname = NULL,
host = NULL,
port = NULL,
user = NULL,
password = NULL,
dbconnopen = FALSE,
showlist = TRUE,
...
)
Arguments
dbname |
String. Name of the database on the host. |
host |
String. Host name. |
port |
String. Port number. |
user |
String. User name. |
password |
String. Password. |
dbconnopen |
Logical. If TRUE, the database connection is returned and not closed. |
showlist |
Logical. If TRUE, prints list of tables in database. |
... |
Additional authentication arguments passed to DBI::dbConnect |
Value
An S4 object that inherits from DBIConnection via the DBI package if dbconnopen = TRUE, or NULL otherwise. For more information, see 'help(DBI::dbConnect)'.
Author(s)
Tracey S. Frescino
Database - Checks access to a SQLite database.
Description
Checks a SQLite database.
Usage
DBtestSQLite(
SQLitefn = NULL,
gpkg = FALSE,
dbconnopen = FALSE,
outfolder = NULL,
showlist = TRUE,
returnpath = TRUE,
createnew = TRUE,
stopifnull = FALSE,
overwrite = TRUE
)
Arguments
SQLitefn |
String. Name of SQLite database (*.sqlite). |
gpkg |
Logical. If TRUE, Sqlite geopackage database. |
dbconnopen |
Logical. If TRUE, the dbconn connection is not closed. |
outfolder |
String. Optional. Name of output folder. If NULL, export to working directory. |
showlist |
Logical. If TRUE, shows list of tables in database. |
returnpath |
Logical. If TRUE, returns full path to SQLite file name. If FALSE, returns SQLitefn. |
createnew |
If TRUE, creates new SQLite database. |
stopifnull |
Logical. If TRUE, stops if SQLite database doesn't exist. |
overwrite |
Logical. If TRUE, overwrites data. |
Value
Character string containing the path to the SQLite database of interest.
Author(s)
Tracey S. Frescino
General Utility Functions
Description
These functions provide a wide-range of general utility for a variety of data types. They were developed by the FIESTA development team and solve many general and specific problems for data analysis in R.
Usage
DBvars.default(
istree = FALSE,
isseed = FALSE,
isveg = FALSE,
isgrm = FALSE,
isdwm = FALSE,
issubp = FALSE,
regionVars = FALSE,
plotgeom = FALSE,
regionVarsRS = "RMRS",
iscwd = FALSE
)
DBgetfn(
tab,
invtype,
outfn.pre,
stabbrlst = NULL,
evalid = NULL,
qry = FALSE,
othertxt = NULL,
outfn.date = FALSE,
addslash = FALSE,
ext = "csv",
outfolder = NULL,
overwrite = FALSE
)
getspconddat(
cond = NULL,
ACTUALcond = NULL,
cuniqueid = "PLT_CN",
condid1 = FALSE,
ACI = FALSE
)
getpfromqry(
dsn = NULL,
evalid = NULL,
plotCur = TRUE,
pjoinid,
varCur = "MEASYEAR",
Endyr = NULL,
invyrs = NULL,
allyrs = FALSE,
SCHEMA. = NULL,
subcycle99 = NULL,
designcd1 = FALSE,
intensity1 = NULL,
popSURVEY = FALSE,
chk = FALSE,
Type = "VOL",
syntax = "sql",
plotnm = "plot",
ppsanm = "pop_plot_stratum_assgn",
ppsaid = "PLT_CN",
surveynm = "survey",
plotobj = NULL,
dbconn = NULL,
dbconnopen = TRUE
)
getpwithqry(
dsn = NULL,
evalid = NULL,
states = NULL,
pjoinid,
plotCur = FALSE,
varCur = "MEASYEAR",
Endyr = NULL,
invyrs = NULL,
measyears = NULL,
allyrs = FALSE,
SCHEMA. = NULL,
invtype = "ANNUAL",
subcycle99 = FALSE,
designcd1 = FALSE,
intensity = NULL,
popSURVEY = FALSE,
chk = FALSE,
Type = "VOL",
syntax = "sql",
plotnm = "plot",
ppsanm = "pop_plot_stratum_assgn",
ppsaid = "PLT_CN",
surveynm = "survey",
PLOTdf = NULL,
pltflds = NULL,
POP_PLOT_STRATUM_ASSGNdf = NULL,
ppsaflds = NULL,
pvars = NULL,
dbconn = NULL,
dbconnopen = TRUE,
withqry2 = FALSE
)
getEvalid.ppsa(
ppsa,
states = NULL,
evalAll = FALSE,
evalCur = FALSE,
evalEndyr = NULL,
evalType = "VOL"
)
getPlotCur(
pltx,
Endyr = NULL,
varCur = "MEASYEAR",
Endyr.filter = NULL,
designcd1 = TRUE
)
gui_filterdf(df, byname = TRUE)
DBgetbyids(dbconn, ids, layernm, layerid = "PLT_CN")
DBcreateSQLite(
SQLitefn = NULL,
gpkg = FALSE,
dbconnopen = FALSE,
outfolder = NULL,
outfn.pre = NULL,
outfn.date = FALSE,
overwrite = FALSE,
returnpath = TRUE,
stopifnull = FALSE
)
changeclass(tab, noIDate = TRUE)
customEvalchk(
states,
measCur = TRUE,
measEndyr = NULL,
measEndyr.filter = NULL,
allyrs = FALSE,
invyrs = NULL,
measyrs = NULL,
invyrtab = NULL,
gui = FALSE
)
checkidx(
dbconn,
tbl = NULL,
index_cols = NULL,
datsource = "sqlite",
schema = "FS_FIADB",
dbconnopen = TRUE
)
createidx(
dbconn,
schema = NULL,
tbl,
index_cols,
unique = FALSE,
dbconnopen = TRUE
)
dbclassify(
dbconn,
tabnm,
classcol,
cutbreaks,
cutlabels,
classnm = NULL,
overwrite = TRUE,
NAto0 = FALSE,
dbconnopen = TRUE,
quiet = FALSE
)
dbclass(
dbconn,
tabnm,
classcol,
classvals,
classlabels,
classnm = NULL,
overwrite = TRUE,
NAto0 = FALSE,
dbconnopen = TRUE,
quiet = FALSE
)
getwithqry(
dsn = NULL,
evalid = NULL,
states = NULL,
pjoinid,
plotCur = FALSE,
varCur = "MEASYEAR",
Endyr = NULL,
invyrs = NULL,
measyears = NULL,
allyrs = FALSE,
SCHEMA. = NULL,
invtype = "ANNUAL",
subcycle99 = FALSE,
designcd1 = FALSE,
intensity1 = FALSE,
popSURVEY = FALSE,
chk = FALSE,
Type = "VOL",
syntax = "sql",
plotnm = "plot",
ppsanm = "pop_plot_stratum_assgn",
ppsaid = "PLT_CN",
surveynm = "survey",
PLOTdf = NULL,
pltflds = NULL,
POP_PLOT_STRATUM_ASSGNdf = NULL,
ppsaflds = NULL,
pvars = NULL,
dbconn = NULL,
dbconnopen = TRUE,
withqry2 = FALSE
)
Ratio2Size(
yn,
y2n = NULL,
yd,
y2d = NULL,
ysum,
dsum,
uniqueid,
esttype,
ratiotype,
stratalut,
RHGlut,
unitvar,
strvar,
domain
)
addCI(x, estnm, senm = NULL, conf.level = c(99, 95, 68), gainloss = FALSE)
change10char(xnms)
check.pltcnt(
pltx,
puniqueid = NULL,
unitlut,
unitvars = NULL,
strvars = NULL,
savedata = FALSE,
outfolder = NULL,
outfn = NULL,
overwrite = FALSE,
outfn.date = TRUE,
outfn.pre = NULL,
minplotnum.unit = 10,
minplotnum.strat = 2,
gui = FALSE,
stopiferror = FALSE,
showwarnings = TRUE
)
RtoSQL(filter, x = NULL)
getext(x)
getoutfn(
outfn,
outfolder = NULL,
outfn.pre = NULL,
outfn.date = FALSE,
overwrite = FALSE,
ext = NULL,
baseonly = FALSE,
noext = FALSE,
outfn.default = "outfile",
add = TRUE,
append = FALSE,
gui = FALSE
)
addcommas(vars, ALIAS = NULL, sepchar = ",", quotes = FALSE, paren = FALSE)
pastevars(vars1, vars2, sep = ",")
stopQ()
removecols(x, vars)
DT_NAto0(DT, cols, changeto = 0)
changeNULL(x, xvar, changeto = NULL)
getdups(cx, cuniqueid = "PLT_CN", varnm, fun)
getlistparam(lst)
getnm(xvar, group = FALSE)
capfirst(x, allwords = FALSE)
nbrdecimals(x)
nbrdigits(x)
getfilter(att, val, syntax = "R", quote = FALSE, like = FALSE)
filter2qry(filt, layernm)
wraptitle(x, len = 10)
xtabf(x, y, levels)
recodelut(lut, minvar = "min", maxvar = "max", classvar = "class")
findnm(x, xvect, returnNULL = FALSE)
chkdbtab(dbtablst, tab, stopifnull = FALSE)
int64tochar(df)
messagedf(df)
getSPGRPCD(states)
addFORTYPGRPCD(cond)
date2char(df, col, formatstr = "%Y-%m-%d")
checklevels(x, uniquex, xvar, keepNA = TRUE)
transpose2row(
x,
uniqueid,
tvars = NULL,
na.rm = TRUE,
tnewname = NULL,
tvalue = NULL,
returnfactor = FALSE
)
transpose2col(x, uniqueid, tvar, value.var, fill = 0, fun.aggregate = sum)
getext(x)
filter2qry(filt, layernm)
recodelut(lut, minvar = "min", maxvar = "max", classvar = "class")
strat.pivot(x, strvar, unitvars, strwtvar = "Prop", strat.levels = NULL)
makedummy(dat, auxlut, predfac)
preds.standardize(plt, aux, prednames)
gregEN.select(
y,
x_sample,
x_pop,
N,
alpha = 0.5,
returncoef = FALSE,
cvfolds = 10
)
preds.select(y, plt, auxlut, prednames, cvfolds = 10)
fileexistsnm(outfolder, basenm, ext)
getEvalid(
states = NULL,
RS = NULL,
evalCur = TRUE,
evalEndyr = NULL,
evalid = NULL,
evalAll = FALSE,
evalType = "VOL",
dbconn = NULL,
schema = NULL,
dbconnopen = FALSE
)
getRefcodes(xvar)
getRefobject(xvar)
getadjfactorDWM(
adj = "samp",
condx,
cuniqueid = "PLT_CN",
condid = "CONDID",
unitlut = NULL,
unitvars = NULL,
strvars = NULL,
unitarea = NULL,
areavar = NULL,
areawt = "SUBP_CONDPROP_UNADJ",
dwmpropvars = NULL
)
getadjfactorGB(
condx = NULL,
treex = NULL,
seedx = NULL,
vcondsppx = NULL,
vcondstrx = NULL,
cond_dwm_calcx = NULL,
tuniqueid = "PLT_CN",
cuniqueid = "PLT_CN",
vuniqueid = "PLT_CN",
duniqueid = "PLT_CN",
condid = "CONDID",
unitlut = NULL,
unitvars = NULL,
strvars = NULL,
unitarea = NULL,
areavar = NULL,
areawt = "CONDPROP_UNADJ",
cvars2keep = NULL,
tpropvars = list(SUBP = "SUBPPROP_UNADJ", MICR = "MICRPROP_UNADJ", MACR =
"MACRPROP_UNADJ")
)
getadjfactorP2VEG(
adj = "samp",
condx,
vcondsppx = NULL,
vcondstrx = NULL,
cuniqueid = "PLT_CN",
vuniqueid = "PLT_CN",
condid = "CONDID",
unitlut = NULL,
unitvars = NULL,
strvars = NULL,
unitarea = NULL,
areavar = NULL,
areawt = "SUBP_CONDPROP_UNADJ",
cvars2keep = NULL
)
getadjfactorPLOT(
condx = NULL,
treex = NULL,
seedx = NULL,
cuniqueid = "PLT_CN",
tuniqueid = "PLT_CN",
condid = "CONDID",
checkNA = TRUE,
areawt = "CONDPROP_UNADJ",
tpropvars = list(SUBP = "SUBPPROP_UNADJ", MICR = "MICRPROP_UNADJ", MACR =
"MACRPROP_UNADJ")
)
getadjfactorVOL(
adj = adj,
condx = NULL,
treex = NULL,
seedx = NULL,
tuniqueid = "PLT_CN",
cuniqueid = "PLT_CN",
condid = "CONDID",
unitlut = NULL,
unitvars = NULL,
strvars = NULL,
unitarea = NULL,
areavar = NULL,
areawt = "CONDPROP_UNADJ",
cvars2keep = NULL,
cpropvars = list(SUBP = "SUBPPROP_UNADJ", MACR = "MACRPROP_UNADJ"),
tpropvars = list(SUBP = "SUBPPROP_UNADJ", MACR = "MACRPROP_UNADJ", MICR =
"MICRPROP_UNADJ"),
keepadjvars = FALSE,
adjvars = NULL
)
getfunnm(x)
getlt10char(dbname)
getpse(
xdat,
esttype = "AREA",
areavar = NULL,
nhatcol = "nhat",
nhatcol.var = "nhat.var",
dhatcol = "dhat",
dhatcol.var = "dhat.var"
)
getrhat(x, percent = FALSE)
groupClasses(x, minplotnum, nvar, xvar, sumvar = "n.strata", xvarlevels = NULL)
groupEstunit(x, minplotnum)
groupStrata(
x,
minplotnum,
nvar = "n.strata",
strvar = NULL,
stratalevels = NULL
)
groupUnits(
tabest,
domain,
esttype = "AREA",
estncol = "estn",
estncol.var = "estn.var",
estdcol = "estd",
estdcol.var = "estd.var",
covarcol = "covar",
grpfun = sum,
domvar2 = NULL,
rowgrpnm = NULL,
unitvar = NULL,
areavar = NULL,
phototype = "PCT",
photoratio = FALSE,
percent = FALSE,
keepvars = NULL
)
getjoinqry(joinid1, joinid2 = NULL, alias1 = "p.", alias2 = "plta.")
classqry(
classcol,
fromval,
toval,
classnm = NULL,
class. = NULL,
prefixnm = NULL,
fill = NULL
)
classifyqry(
classcol,
cutbreaks,
cutlabels = NULL,
classnm = NULL,
class. = NULL,
prefixnm = NULL,
fill = NULL
)
getcombineqry(lut, unitvars, classcols, fromcols, tocols, tab. = "")
save1tab(
tab,
tab.title = NULL,
outfolder,
allin1 = TRUE,
coltitlerow = TRUE,
coltitle = NULL,
addtitle = TRUE,
rowtotal = TRUE,
rnames = NULL,
outfn = NULL,
addformat = TRUE,
charvars = NULL,
outfn.date = TRUE,
overwrite = FALSE,
cols2format = NULL
)
save2tabs(
tab1,
tab2,
tab1.title,
tab2.title,
outfolder,
coltitlerow = TRUE,
coltitle = NULL,
addtitle = TRUE,
rowtotal = TRUE,
rnames = NULL,
outfn.estpse = NULL,
outfn.date = TRUE,
overwrite = FALSE
)
strat.collapse(
stratacnt,
pltstratx,
minplotnum.unit = 10,
minplotnum.strat = 2,
unitarea,
areavar,
unitvar,
unitvar2 = NULL,
strvar,
getwt = FALSE,
stratcombine = TRUE,
unitcombine = FALSE,
stratalevels = NULL,
vars2combine = NULL,
UNITCD = NULL,
...
)
subpsamp(
cond,
subp_cond,
subplot,
data_dsn = NULL,
subpuniqueid = "PLT_CN",
subpid = "SUBP",
ACI = FALSE,
whereqry = NULL
)
subpsampP2VEG(
plt,
cond,
subp_cond,
subplot,
data_dsn = NULL,
subpuniqueid = "PLT_CN",
subpid = "SUBP",
ACI = FALSE,
whereqry = NULL
)
allin1f(
x,
y,
char.width = NULL,
estnull = "--",
psenull = "--",
estround = NULL,
pseround = NULL
)
crosstabx(
x,
xvar,
estnm,
psenm,
allin1 = FALSE,
char.width = NULL,
estround = NULL,
pseround = NULL,
estnull = "--",
psenull = "--"
)
add0unit(
x,
xvar,
uniquex,
unitvar = NULL,
xvar.add0 = FALSE,
xvar2 = NULL,
uniquex2 = NULL,
xvar2.add0 = FALSE
)
addrowgrp(x, uniquerow, rowvar, rowgrpnm, title.rnames = NULL)
crossxtab(
group.est,
rowvar.est = NULL,
colvar.est = NULL,
total.est = NULL,
rowvar,
colvar,
estnm,
psenm,
estround = NULL,
pseround = NULL,
gtotal = TRUE,
allin1 = FALSE,
rowgrp = FALSE,
rowgrpnm = NULL,
title.rnames = NULL,
estnull = 0,
psenull = "--",
char.width = NULL
)
getdomain()
getestvar()
crossxbyunit(
unit = NULL,
unit_grpest = NULL,
unit_rowest = NULL,
unit_colest = NULL,
unit_totest = NULL,
unitvar,
rowvar,
colvar,
estnm,
psenm,
allin1,
char.width,
estnull,
psenull,
estround = NULL,
pseround = NULL,
rowgrp = NULL,
rowgrpnm = NULL,
title.rnames = NULL,
numunits,
savedata,
addtitle,
returntitle,
outfn.estpse,
title.estpse,
title.est,
title.pse,
title.ref,
outfolder,
outfn.date,
overwrite,
esttype,
phototype,
rnames = NULL,
title.colvar = NULL,
title.unitvar = NULL
)
ptdata2sf(
ptdata,
crs,
coords = c(2, 3),
asSpatial = FALSE,
stringsAsFactors = FALSE
)
sf2ptdata(ptlayer, id_fld = 1, stringsAsFactors = FALSE)
layerIntersection(
layer1,
layer2,
asSpatial = FALSE,
dropLowerDimGeom = TRUE,
stringsAsFactors = FALSE
)
layerUnion(
layer1,
layer2,
asSpatial = FALSE,
dropLowerDimGeom = TRUE,
sfColName = "geometry",
stringsAsFactors = FALSE
)
tabulateIntersections(
layer1,
layer1fld,
layer2,
layer2fld = NULL,
stringsAsFactors = FALSE,
withUnits = FALSE
)
selectByIntersects(
layer1,
layer2,
overlapThreshold = 0,
thresholdAsPct = TRUE,
asSpatial = FALSE,
stringsAsFactors = FALSE
)
layerFromRasterExtent(rasterfile, asSpatial = FALSE)
wtcalc(wtLUT, strvar, acrevar)
wtcalc.unit(wtLUT, strvar, unit, unitvar, acrevar)
Details
These functions provide a wide-range of general utility for a variety of data types.
Value
Object for internal use by other functions in FIESTAutils or other packages used for USDA Forest Service data analysis.
Author(s)
Tracey S. Frescino, Chris Toney, Grayson W. White
Estimation Functions
Description
These functions carry out direct, model-assisted, and small area estimation through three different modules: "Green Book", "Model-Assisted", and "Small Area".
Usage
GBest.pbar(
sumyn = "CONDPROP_ADJ",
ysum,
sumyd = NULL,
esttype = "AREA",
ratiotype = "PERACRE",
stratalut,
uniqueid,
unitvar,
strvar = NULL,
domain
)
MAest.ht(y, N, FIA = TRUE, getweights = FALSE, var_method = "LinHTSRS")
MAest.ps(
y,
N,
x_sample,
x_pop,
FIA = TRUE,
save4testing = FALSE,
getweights = FALSE,
var_method = "SRSunconditional"
)
MAest.greg(
y,
N,
x_sample,
x_pop,
FIA = TRUE,
save4testing = TRUE,
modelselect = FALSE,
getweights = FALSE,
var_method = "LinHTSRS"
)
MAest.ratio(
y,
N,
x_sample,
x_pop,
FIA = TRUE,
save4testing = TRUE,
var_method = "LinHTSRS"
)
MAest.gregEN(
y,
N,
x_sample,
x_pop,
FIA = TRUE,
model = "linear",
save4testing = TRUE,
getweights = FALSE,
var_method = "LinHTSRS"
)
MAest.gregRatio(
yn,
yd,
N,
area,
x_sample,
x_pop,
FIA = TRUE,
save4testing = FALSE,
modelselect = FALSE,
getweights = FALSE,
var_method = "LinHTSRS"
)
MAest(
yn = "CONDPROP_ADJ",
dat.dom,
cuniqueid,
unitlut = NULL,
pltassgn,
esttype = "ACRES",
MAmethod,
strvar = NULL,
prednames = NULL,
yd = NULL,
ratiotype = "PERACRE",
N,
area,
FIA = TRUE,
modelselect = FALSE,
getweights = FALSE,
var_method = ifelse(MAmethod %in% c("PS"), "SRSunconditional", "LinHTSRS")
)
MAest.dom(
dom,
dat,
cuniqueid,
unitlut,
pltassgn,
esttype,
MAmethod,
strvar = NULL,
prednames = NULL,
domain,
N,
area = NULL,
response = NULL,
response_d = NULL,
FIA = TRUE,
modelselect = FALSE,
getweights = FALSE,
var_method = ifelse(MAmethod %in% c("PS"), "SRSunconditional", "LinHTSRS"),
quiet = FALSE
)
MAest.unit(
unit,
dat,
cuniqueid,
unitlut,
unitvar,
esttype,
MAmethod = "HT",
strvar = NULL,
prednames = NULL,
domain,
response,
response_d = NULL,
npixels,
unitarea = NULL,
FIA = TRUE,
modelselect = FALSE,
getweights = FALSE,
var_method = ifelse(MAmethod %in% c("PS"), "SRSunconditional", "LinHTSRS"),
quiet = FALSE
)
PBest.pbar(
dom.prop,
uniqueid,
domain,
strtype = "post",
stratalut,
strunitvars,
unitvars,
strvar
)
PBest.pbarRatio(
dom.prop.n,
dom.prop.d,
uniqueid,
domain,
attribute,
strtype = "post",
stratalut,
strunitvars,
unitvars,
strvar
)
SAest.unit(
fmla.dom.unit,
pltdat.dom,
dunitlut.dom,
yn,
SApackage,
dunitvar,
predselect.unit,
prior = NULL
)
SAest.area(
fmla.dom.area,
pltdat.area,
dunitlut.area,
cuniqueid,
dunitvar = "DOMAIN",
predselect.area,
yn,
SApackage,
prior = NULL
)
SAest(
yn = "CONDPROP_ADJ",
dat.dom,
cuniqueid,
pltassgn,
dunitlut,
prednames = NULL,
dunitvar = "DOMAIN",
SAmethod = "unit",
SApackage = "JoSAE",
yd = NULL,
ratiotype = "PERACRE",
largebnd.val = NULL,
showsteps = FALSE,
savesteps = FALSE,
stepfolder = NULL,
prior = NULL,
modelselect = TRUE,
multest = TRUE,
multest_estimators = NULL,
bayes = FALSE,
bayes_opts = NULL,
save4testing = FALSE
)
SAest.dom(
dom,
dat,
cuniqueid,
dunitlut,
pltassgn,
dunitvar = "DOMAIN",
SApackage,
SAmethod,
prednames = NULL,
domain,
response = NULL,
largebnd.val = NULL,
showsteps = FALSE,
savesteps = FALSE,
stepfolder = NULL,
prior = NULL,
modelselect = TRUE,
multest = TRUE,
multest_estimators = NULL,
bayes = FALSE,
bayes_opts = NULL,
save4testing = FALSE,
quiet = FALSE
)
SAest.large(
largebnd.val,
dat,
cuniqueid,
largebnd.unique,
dunitlut,
dunitvar = "DOMAIN",
SApackage = "JoSAE",
SAmethod = "unit",
domain,
response,
prednames = NULL,
showsteps = FALSE,
savesteps = FALSE,
stepfolder = NULL,
prior = NULL,
modelselect = TRUE,
multest = TRUE,
multest_estimators = "all",
bayes = FALSE,
bayes_opts = NULL,
vars2keep = NULL,
save4testing = FALSE,
quiet = FALSE
)
Details
These functions can carry out estimation with data from a variety of domains, but are designed for USFS FIA data.
Value
List object containing estimates produced. If GB or PB estimation, output is directly from FIESTAutils, while outputs for MA or SA will be list objects from packages such as 'mase', 'sae', 'hbsae', or 'JoSAE'.
Author(s)
Tracey S. Frescino, Grayson W. White
Reference tables - gdal data types.
Description
Table with gdal data type names.
Format
A vector of 12 data type values.
Source
gdal values.
Check Functions
Description
Check functions for objects of class numeric, logical statements, class matching, value matching, file names, names, and named lists
Usage
check.numeric(x)
check.logic.vars(varlst, statement, ignore.case = FALSE, returnVars = FALSE)
check.logic(
x,
statement,
filternm = NULL,
stopifnull = FALSE,
stopifinvalid = TRUE,
removeinvalid = FALSE,
syntax = "R",
returnvar = FALSE,
returnpart = FALSE
)
check.matchclass(
tab1,
tab2,
matchcol,
var2 = NULL,
tab1txt = NULL,
tab2txt = NULL
)
check.matchval(
tab1,
tab2,
var1,
var2 = NULL,
tab1txt = NULL,
tab2txt = NULL,
gui = FALSE,
stopifmiss = FALSE,
subsetrows = FALSE
)
check.unique(x, xvar, uniquex, NAname = "Other", addfactors = TRUE)
check.pcfilter(
pcfilter,
pltflds = NULL,
condflds = NULL,
pltfldsa. = "p.",
condfldsa. = "c.",
syntax = "SQL"
)
checkfilenm(fn, outfolder = NULL, ext = NULL, stopifnull = FALSE)
checknm(nm, nmlst, ignore.case = TRUE)
check.namedlist(xlst, checknms = NULL, modetype = "numeric")
Details
These functions are used to check if a vector is numeric with check.numeric, to check a logical statement with check.logic, to check if two objects' classes match, to check it two object's values match, to check file names, to check names, and finally, to check named lists.
Value
The object who was checked, with necessary changes made for the object to pass the check (i.e. character vector to numeric vector).
Author(s)
Tracey S. Frescino
Spatial - Exports a data frame object.
Description
Exports a data frame object to a specified output.
Usage
datExportData(
dfobj,
create_dsn = FALSE,
index.unique = NULL,
index = NULL,
lowernames = FALSE,
savedata_opts = savedata_options(),
dbconn = NULL,
dbconnopen = TRUE
)
Arguments
dfobj |
Data.frame class R object. Data frame object to export. |
create_dsn |
Boolean. |
index.unique |
String. Name of variable(s) in dfobj to make unique index. |
index |
String. Name of variable(s) in dfobj to make (non-unique) index. |
lowernames |
Logical. If TRUE, convert column names to lowercase before writing to output. dbconnopen Logical. If TRUE, keep database connection open. |
savedata_opts |
List. See help(savedata_options()) for a list of options. |
dbconn |
Open database connection. |
dbconnopen |
Logical. If TRUE, keep database connection open. |
Details
Wrapper for sf::st_write function.
Value
An sf spatial object is written to the out_dsn.
Note
If out_fmt='shp':
The ESRI shapefile driver truncates variable
names to 10 characters or less. Variable names are changed before export
using an internal function (trunc10shp). Name changes are output to the
outfolder, 'outshpnm'_newnames.csv.
If sf object has more than 1 record, it cannot be exported to a shapefile.
Author(s)
Tracey S. Frescino
Options for summarizing tree data.
Description
Returns a list of user-supplied parameters and parameter values for summarizing tree data.
Usage
datSum_options(
lbs2tons = TRUE,
metric = FALSE,
tround = 5,
TPA = TRUE,
adjTPA = 1,
ACI = FALSE,
adjtree = FALSE,
adjvar = "tadjfac",
keepall = FALSE,
NAto0 = TRUE,
...
)
Arguments
lbs2tons |
Logical. If TRUE, converts biomass or carbon variables from pounds to tons (1 pound = 0.0005 short tons). If metric=TRUE, converts to metric tons, else short tons. |
metric |
Logical. If TRUE, converts response to metric units based on ref_conversion, if any variable in tsumvarlst is in FIESTAutils::ref_estvar. Note: if TPA, TPA is converted to trees per hectare (TPH: (1/ tpavar * 0.4046860)). |
tround |
Number. The number of digits to round to. If NULL, default=5. |
TPA |
Logical. If TRUE, tsumvarlst variable(s) are multiplied by the respective trees-per-acre variable (see details) to get per-acre measurements. |
adjTPA |
Numeric. A tree-per-acre adjustment. Use for DESIGNCD=1 (annual inventory), if using less than 4 subplots. If using only 1 subplot for estimate, adjTPA=4. The default is 1. |
ACI |
Logical. If TRUE, if ACI (All Condition Inventory) plots exist, any trees on these plots will be included in summary. If FALSE, you must include condition table. |
adjtree |
Logical. If TRUE, trees are individually adjusted by adjustment factors. Adjustment factors must be included in tree table (see adjvar). |
adjvar |
String. If adjtree=TRUE, the name of the variable to use for multiplying by adjustment (e.g., tadjfac). |
keepall |
Logical. If TRUE, keeps all plots in dataset with NA values. If FALSE, keeps only summed data when not NA. |
NAto0 |
Logical. If TRUE, change NA values to 0 |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for summarizing tree data.
Author(s)
Tracey S. Frescino
Examples
datSum_options(lbs2tons = TRUE, metric = TRUE)
Database options.
Description
Returns a list of user-supplied parameters and parameter values for database access.
Usage
database_options(
dbname = NULL,
host = NULL,
port = NULL,
user = NULL,
password = NULL,
schema = NULL,
dbconnopen = TRUE,
...
)
Arguments
dbname |
String. Name of database. |
host |
String. Name of database host. |
port |
String. Database port. |
user |
String. User name for database access. |
password |
String. Password for database access. |
schema |
String. Name of schema in database. |
dbconnopen |
Logical. If TRUE, keep database connection open. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for saving data.
Author(s)
Tracey S. Frescino
Examples
savedata_options(outfolder = "path", overwrite_dsn = FALSE)
List of population tables.
Description
Returns a list of user-supplied parameters and parameter values for data evaluation (FIA or custom) extraction to be supplied to *DB functions.
Usage
eval_options(
Cur = FALSE,
Endyr = NULL,
All = FALSE,
Type = "VOL",
evalid = NULL,
invyrs = NULL,
measyrs = NULL,
varCur = "INVYR",
evalType = NULL,
Endyr.filter = NULL,
Endyr.bnd = NULL,
...
)
Arguments
Cur |
Logical. If eval='FIA': extract plots with most current evaluation. If eval='custom': extract the most current sampled plots in the database. |
Endyr |
Integer (YYYY). If eval='FIA', defines end year for extracting one or more FIA evaluation. If eval='custom', defines end year for extracting the most current sampled plots until. |
All |
Logical. If eval='FIA': includes all evaluations in database (annual inventory only). If eval='custom': includes all years in database (annual inventory only). |
Type |
String vector. Evaluation types ('ALL','CURR','VOL','P2VEG', DWM','INV','CHNG','GRM','REGEN'). If eval='FIA', Type is equivalent to plots for FIA Evaluations where 'ALL' includes nonsampled plots; 'CURR' and 'VOL' include plots used for area or tree estimates, respectively; Type = 'GRM' includes plots used for growth, removals, mortality; and Type = 'CHNG' includes plots used for change estimates (See FIA database manual for regioin availability and/or differences (https://www.fia.fs.usda.gov/library/database-documentation/index.php) If eval='custom', the associated tables are extracted for each Type. Multiple Types are accepted. |
evalid |
Integer. Only eval='FIA': extract data for a specific evaluation period. See notes for more information about FIA Evaluations. |
invyrs |
Integer vector. eval='custom': defines specific inventory years of data (e.g., 2010:2015). See FIA manual for definition of INVYR. |
measyrs |
Integer vector. eval='custom': defines specific measurement years of data (e.g., 2010:2015). |
varCur |
String. Name of variable to use for most current plot ('MEASYEAR', 'INVYR'). |
evalType |
Deprecated. Use Type instead. |
Endyr.filter |
Filter. If endyr != NULL, a filter to identify when to use Endyr, such as areas or plots identified as being disturbed in a particular year. In this example, plots sampled after the disturbance will be excluded. |
Endyr.bnd |
sf object. A boundary to use for filter to idnentify when to use Endyr. The Endyr.bnd is unioned with bnd, then filtered. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for strata.
Author(s)
Tracey S. Frescino
Examples
eval_options(invyrs = 2015:2018)
Raster Functions
Description
These functions allow for analysis of raster data. Many are written in C++ to be extremely efficient and fast. Some are wrappers around these C++ functions for easier use and integration into other packages.
Usage
getDefaultNodata(GDT_name)
getOffset(coord, origin, gt_pixel_size)
getGDALformat(file)
basename.NoExt(filepath)
Mode(x, na.rm = FALSE)
Modes(x, na.rm = FALSE)
northness(asp_deg)
eastness(asp_deg)
roughness(x, na.rm = FALSE, asInt = TRUE)
TRI(x, na.rm = FALSE, asInt = TRUE)
TPI(x, na.rm = FALSE, asInt = TRUE)
getPixelValue(
pt,
ds,
ri = NULL,
band = 1,
interpolate = FALSE,
windowsize = 1,
statistic = NULL,
na.rm = TRUE
)
.getPixelValue(pt, rasterfile, ds, ...)
extractPtsFromRaster(
ptdata,
rasterfile,
band = NULL,
var.name = NULL,
interpolate = FALSE,
windowsize = 1,
statistic = NULL,
na.rm = TRUE,
ncores = 1
)
extractPtsFromRasterList(
ptdata,
rasterfiles,
bands = NULL,
var.names = NULL,
interpolate = FALSE,
windowsizes = NULL,
statistics = NULL,
na.rm = TRUE,
ncores = 1
)
rasterInfo(srcfile)
reprojectRaster(
srcfile,
dstfile,
t_srs,
overwrite = TRUE,
s_srs = NULL,
of = NULL,
ot = NULL,
te = NULL,
tr = NULL,
r = NULL,
dstnodata = NULL,
co = NULL,
addOptions = NULL
)
rasterFromVectorExtent(
src,
dstfile,
res,
fmt = NULL,
nbands = 1,
dtName = "Int16",
options = NULL,
init = NULL,
dstnodata = init
)
rasterizePolygons(dsn, layer, burn_value, rasterfile, src = NULL)
clipRaster(
dsn = NULL,
layer = NULL,
src = NULL,
srcfile,
src_band = NULL,
dstfile,
fmt = NULL,
options = NULL,
init = NULL,
dstnodata = NULL,
maskByPolygons = TRUE
)
recodeRaster(srcfile, dstfile, lut, srcband = 1, ...)
pixelCount(rasterfile, band = 1)
focalRaster(
srcfile,
dstfile,
w,
fun = sum,
na.rm = FALSE,
...,
fmt = NULL,
dtName = NULL,
options = NULL,
nodata_value = NULL,
setRasterNodataValue = FALSE,
srcband = NULL
)
zonalStats(
dsn = NULL,
layer = NULL,
src = NULL,
attribute,
rasterfile,
band = 1,
lut = NULL,
pixelfun = NULL,
na.rm = TRUE,
ignoreValue = NULL,
show_progress = FALSE
)
zonalMean(
dsn = NULL,
layer = NULL,
src = NULL,
attribute,
rasterfile,
band = 1,
lut = NULL,
pixelfun = NULL,
na.rm = TRUE,
...
)
zonalFreq(
dsn = NULL,
layer = NULL,
src = NULL,
attribute,
rasterfile,
band = 1,
aggfun = NULL,
lut = NULL,
na.rm = FALSE,
ignoreValue = NULL,
show_progress = FALSE
)
zonalMajority(
dsn = NULL,
layer = NULL,
src = NULL,
attribute,
rasterfile,
band = 1,
lut = NULL,
...
)
zonalMinority(
dsn = NULL,
layer = NULL,
src = NULL,
attribute,
rasterfile,
band = 1,
lut = NULL,
...
)
zonalVariety(
dsn = NULL,
layer = NULL,
src = NULL,
attribute,
rasterfile,
band = 1,
lut = NULL,
...
)
zonalBayes(
dsn = NULL,
layer = NULL,
src = NULL,
zoneidfld,
helperidfld = NULL,
rasterfiles,
prednames,
predfun,
xy = FALSE,
nMCMC = 100
)
getrastlst(
rastnmlst,
rastfolder = NULL,
stopifLonLat = FALSE,
stopifnull = FALSE,
stopifinvalid = FALSE,
gui = FALSE,
quiet = FALSE
)
areacalc.pixel(rastfn, unit = "ACRES", rast.NODATA = NULL, na.rm = TRUE)
aspect_transform(df, asp)
checkrast.longlat(rastfn, dstfile = NULL, nolonglat = TRUE, crs.default = NULL)
getrastlst.rgdal(
rastnmlst,
rastfolder = NULL,
stopifLonLat = FALSE,
stopifnull = FALSE,
stopifinvalid = FALSE,
gui = FALSE,
quiet = FALSE
)
Details
These functions carry out raster data analysis.
Value
Spatial data object from 'sf'. Used for spatial data analyses.
Author(s)
Chris Toney, Tracey S. Frescino
Reference table - List of RMRS plots that have fallen out of inventory because they were not found or they were in the wrong place.
Description
Table with variable codes (VALUE) and descriptions (MEANING).
Format
A dataframe
Source
FIA query. SELECT bp.STATECD, bp.COUNTYCD, bp.PLOT_FIADB NEW_PLOT, bp.START_DATE NEW_START_DATE, bp_old.COUNTYCD OLD_COUNTYCD, bp_old.PLOT_FIADB OLD_PLOT, bp_old.END_DATE OLD_END_DATE, p.CN FROM fs_nims_rmrs.NIMS_BASE_PLOT bp JOIN fs_nims_rmrs.NIMS_BASE_PLOT bp_old on (bp.PREV_NBP_CN=bp_old.CN) JOIN fs_nims_rmrs.NIMS_PLOT_RMRS_VW p on(p.NBP_CN=bp_old.CN) WHERE p.KINDCD = 1 ORDER BY bp.STATECD, bp.COUNTYCD, bp_old.PLOT_FIADB"
Multest output options.
Description
Returns a list of user-supplied parameters and parameter values for outputting multest with custom aesthetics.
Usage
multest_options(
multest_estimators = "all",
multest_fmt = "csv",
multest_outfolder = NULL,
multest_dsn = NULL,
multest_layer = NULL,
multest.append = FALSE,
multest.AOIonly = FALSE,
...
)
Arguments
multest_estimators |
String vector. If multest = TRUE, vector of estimators to include in multest output ('JU.GREG','JU.EBLUP','JFH','hbsaeU','hbsaeA'). See ref_estimators for descriptions. Use multest_estimators = 'all' to output all estimators. |
multest_fmt |
String. Format for multest output tables ('csv', 'sqlite', 'gpkg'). |
multest_outfolder |
String. Outfolder for multest. If NULL, same as outfolder. |
multest_dsn |
String. Name of database if multest_fmt = c('sqlite', 'gpkg'). |
multest_layer |
String. Name of database layer if multest_fmt = c('sqlite', 'gpkg'). |
multest.append |
Logical. If TRUE, appends multest dataframe to output. |
multest.AOIonly |
Logical. If TRUE, appends multest dataframe (AOI=1) to output. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for outputting multest.
Author(s)
Grayson W. White
Examples
multest_options(multest.append = TRUE)
Parameter Check Functions
Description
These functions are used to check parameter inputs.
Usage
pcheck.logical(
var2check,
varnm = NULL,
title = NULL,
first = "YES",
gui = FALSE,
stopifnull = FALSE
)
pcheck.unique(
tab,
uniqueid,
gui = FALSE,
tabnm = NULL,
warn = NULL,
stopifnull = FALSE,
stopifinvalid = TRUE,
multiple = FALSE,
...
)
pcheck.varchar(
var2check,
varnm = NULL,
checklst,
gui = FALSE,
caption = NULL,
warn = NULL,
stopifnull = FALSE,
stopifinvalid = TRUE,
multiple = FALSE,
...
)
pcheck.dsn(dsn, dbconnopen = TRUE)
pcheck.table(
tab = NULL,
conn = NULL,
tab_dsn = NULL,
tabnm = NULL,
tabqry = NULL,
caption = NULL,
returnsf = TRUE,
factors = FALSE,
returnDT = TRUE,
warn = NULL,
stopifnull = FALSE,
stopifinvalid = FALSE,
nullcheck = FALSE,
obj = FALSE,
checkonly = FALSE,
gui = FALSE
)
pcheck.outfolder(outfolder, default = getwd(), gui = FALSE)
pcheck.states(
states,
statereturn = "MEANING",
gui = FALSE,
RS = NULL,
stopifnull = FALSE,
...
)
pcheck.object(
obj = NULL,
objnm = NULL,
warn = NULL,
caption = NULL,
stopifnull = FALSE,
gui = FALSE,
list.items = NULL
)
pcheck.output(
out_fmt = "csv",
outsp_fmt = "shp",
out_dsn = NULL,
outfolder = NULL,
outfn.pre = NULL,
outfn.date = FALSE,
overwrite_dsn = FALSE,
overwrite_layer = TRUE,
add_layer = TRUE,
append_layer = FALSE,
createSQLite = FALSE,
out_conn = NULL,
outconn = NULL,
dbconnopen = FALSE,
gui = FALSE,
savedata_opts = NULL
)
pcheck.colors(colorlst, n)
pcheck.areaunits(unitarea, areavar, areaunits, metric = FALSE)
pcheck.spatial(
layer = NULL,
dsn = NULL,
sql = NA,
fmt = NULL,
tabnm = NULL,
caption = NULL,
stopifnull = FALSE,
gui = FALSE,
polyfix = FALSE,
dropgeom = FALSE,
stopifnoCRS = TRUE,
checkonly = FALSE
)
pcheck.params(
input.params,
strata_opts = NULL,
unit_opts = NULL,
table_opts = NULL,
title_opts = NULL,
savedata_opts = NULL,
multest_opts = NULL,
spMakeSpatial_opts = NULL,
eval_opts = NULL,
xy_opts = NULL,
database_opts = NULL,
datSum_opts = NULL
)
pcheck.opts(optionlst)
popTabchk(tabnames, tabtext, tabs, tabIDs, dbtablst, dbconn, datindb = FALSE)
Details
These functions are used to check parameter inputs.
Value
List of parameter objects checked by the function. While the 'pcheck.*()' functions do return a value, they are primarily used for their side effects when checking input function parameters.
Author(s)
Tracey S. Frescino
Population data filters.
Description
Returns a list of user-supplied parameters and parameter values for population data filters.
Usage
popFilters(
evalid = NULL,
states = NULL,
evalCur = FALSE,
evalEndyr = NULL,
measCur = FALSE,
measEndyr = NULL,
invyrs = NULL,
measyrs = NULL,
intensity = NULL,
ACI = FALSE,
AOIonly = FALSE,
pfilter = NULL,
...
)
Arguments
evalid |
Numeric. FIA Evaluation identifier for subsetting plots for population. |
states |
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. |
evalCur |
Logical. If TRUE, the most current FIA Evaluation is extracted for state(s). |
evalEndyr |
Number. The end year of the FIA Evaluation 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). |
measCur |
Logical. If TRUE, the most current sampled plots available for state(s). |
measEndyr |
Number. The most current sampled plots measured before or during end given.. |
invyrs |
Integer vector. Inventory year(s) (e.g., c(2000, 2001, 2002)). |
measyrs |
Integer vector. Measurement year(s) (e.g., c(2000, 2001, 2002)). |
intensity |
Integer code. Code(s) indicating intensity to use for population. |
ACI |
Logical. If TRUE, including All Condition Inventory (ACI) plots. |
AOIonly |
Logical. If TRUE, and there is an AOI (1/0) attribute in the population data, only AOI=1 are used for estimation. |
pfilter |
String. Logical filter for plot or pltassgn. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for population data filters.
Author(s)
Grayson W. White
List of population table unique IDs.
Description
Returns a list of user-supplied parameters and parameter values for data table unique IDs to be supplied to *pop functions.
Usage
popTableIDs(
cond = "PLT_CN",
plt = "CN",
tree = "PLT_CN",
seed = "PLT_CN",
seedling = "PLT_CN",
vsubpspp = "PLT_CN",
p2veg_subplot_spp = "PLT_CN",
vsubpstr = "PLT_CN",
p2veg_subp_structure = "PLT_CN",
invsubp = "PLT_CN",
invasive_subplot_spp = "PLT_CN",
subplot = "PLT_CN",
subp_cond = "PLT_CN",
dwm = "PLT_CN",
cond_dwm_calc = "PLT_CN",
sccm = "PLT_CN",
subp_cond_chng_mtrx = "PLT_CN",
grm = "PLT_CN",
tree_grm_component = "PLT_CN",
begin = "PLT_CN",
tree_grm_begin = "PLT_CN",
midpt = "PLT_CN",
tree_grm_midpt = "PLT_CN",
plot = "CN",
pltu = "CN",
plotu = "CN",
condu = "PLT_CN",
...
)
Arguments
cond |
String. Unique identifier of plot in cond. |
plt |
String. Unique identifier of plot in plt. |
tree |
String. Unique identifier of plot in tree and seed. |
seed |
String. |
seedling |
String. |
vsubpspp |
String. |
p2veg_subplot_spp |
String. |
vsubpstr |
String. |
p2veg_subp_structure |
String. |
invsubp |
String. |
invasive_subplot_spp |
String. |
subplot |
String. |
subp_cond |
String. |
dwm |
String. |
cond_dwm_calc |
String. |
sccm |
String. |
subp_cond_chng_mtrx |
String. |
grm |
String. |
tree_grm_component |
String. |
begin |
String. |
tree_grm_begin |
String. |
midpt |
String. |
tree_grm_midpt |
String. |
plot |
String. |
pltu |
String. |
plotu |
String. |
condu |
String. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied unique identifier of a plot in population tables.
Author(s)
Grayson W. White
List of population tables.
Description
Returns a list of user-supplied parameters and parameter values for data tables to be supplied to *pop functions.
Usage
popTables(
cond = "COND",
plt = "PLOT",
tree = "TREE",
seed = "SEEDLING",
seedling = "SEEDLING",
vsubpspp = "P2VEG_SUBPLOT_SPP",
p2veg_subplot_spp = "P2VEG_SUBPLOT_SPP",
vsubpstr = "P2VEG_SUBP_STRUCTURE",
p2veg_subp_structure = "P2VEG_SUBP_STRUCTURE",
invsubp = "INVASIVE_SUBPLOT_SPP",
invasive_subplot_spp = "INVASIVE_SUBPLOT_SPP",
subplot = "SUBPLOT",
subp_cond = "SUBP_COND",
dwm = "COND_DWM_CALC",
cond_dwm_calc = "COND_DWM_CALC",
sccm = "SUBP_COND_CHNG_MTRX",
subp_cond_chng_mtrx = "SUBP_COND_CHNG_MTRX",
grm = "TREE_GRM_COMPONENT",
tree_grm_component = "TREE_GRM_COMPONENT",
begin = "TREE_GRM_BEGIN",
tree_grm_begin = "TREE_GRM_BEGIN",
midpt = "TREE_GRM_MIDPT",
tree_grm_midpt = "TREE_GRM_MIDPT",
plot = "plot",
pltu = "pltu",
plotu = "plotu",
condu = "condu",
...
)
Arguments
cond |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Condition-level data with one record for each condition, including or excluding nonsampled conditions. Plot variables and strata/estimation unit variable(s) may be included if plt and pltassgn=NULL. See details for necessary variables to include. |
plt |
DF/DT, Optional. R object, sf R object, comma-delimited file(*.csv), layer or spatial layer in dsn, or shapefile(*.shp). Plot-level data with one record for each plot, including or excluding nonsampled conditions. If nonsampled plots are included, PLOT_STATUS_CD variable must be in table or a filter defined in plt.nonsamp.filter. |
tree |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Tree-level data with one record for each tree. Tree data are aggregated to condition-level. See details for necessary variables to include. |
seed |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Seedling data with one record for each seedling count. |
seedling |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Seedling data with one record for each seedling count. |
vsubpspp |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Vegetation species-level data with one record for each species (P2VEG_SUBPLOT_SPP). |
p2veg_subplot_spp |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Vegetation species-level data with one record for each species (P2VEG_SUBPLOT_SPP). |
vsubpstr |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Vegetation species-structure data with one record for each species (P2VEG_SUBP_STRUCTURE). |
p2veg_subp_structure |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Vegetation species-structure data with one record for each species (P2VEG_SUBP_STRUCTURE). |
invsubp |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Invasive species data with one record for each species (INVASIVE_SUBPLOT_SPP). |
invasive_subplot_spp |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Invasive species data with one record for each species (INVASIVE_SUBPLOT_SPP). |
subplot |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Subplot-level data with one record for each species (SUBPLOT). |
subp_cond |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Subplot condition-level data with one record for each species (SUBP_COND). |
dwm |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Calculated down woody material (COND_DWM_CALC). |
cond_dwm_calc |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Calculated down woody material (COND_DWM_CALC). |
sccm |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Subplot-level data (SUBP_COND_CHNG_MTRX). |
subp_cond_chng_mtrx |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Subplot-level data (SUBP_COND_CHNG_MTRX). |
grm |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Tree-level growth, removal, and mortality data (TREE_GRM_COMPONENT). |
tree_grm_component |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Tree-level growth, removal, and mortality data (TREE_GRM_COMPONENT). |
begin |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Tree-level growth, removal, and mortality data (TREE_GRM_BEGIN). |
tree_grm_begin |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Tree-level growth, removal, and mortality data (TREE_GRM_BEGIN). |
midpt |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Tree-level growth, removal, and mortality data (TREE_GRM_MIDPT). |
tree_grm_midpt |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Tree-level growth, removal, and mortality data (TREE_GRM_MIDPT). |
plot |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Plot data unioned with remeasured plot data. |
pltu |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Plot data unioned with remeasured plot data. |
plotu |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Plot data unioned with remeasured plot data. |
condu |
DF/DT, R object, comma-delimited file(*.csv), or layer in dsn. Cond data unioned with remeasured cond data. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for strata.
Author(s)
Grayson W. White
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- gdalraster
Reference tables - Code definitions.
Description
Table with variable codes (VALUE) and descriptions (MEANING).
Format
A dataframe with 7 columns, VARIABLE, VALUE, MEANING, COLORHEX, GROUP, GROUPNM, GROUPHEX.
Source
FIA look-up tables.
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference tables - Code definitions (Archive).
Description
Table with variable codes (VALUE) and descriptions (MEANING).
Format
A dataframe with 7 columns, VARIABLE, VALUE, MEANING, COLORHEX, GROUP, GROUPNM, GROUPHEX.
Source
FIA look-up tables.
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - Metadata for cond default variables output from DBgetPlots()
Description
Data frame with variable names and descriptions
Format
A data frame with 61 rows and 3 columns VARIABLE - Variable in cond data frame DESCRIPTION - Description of variable in cond data frame TABLE - Table in database where variable originates or if derived
Source
FIA look-up table
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - for conversion factors.
Description
Table with conversion factors from English to metric units.
Format
A dataframe with 6 columns: TYPE, ENGLISH, ENGLISH_ABBR, METRIC, METRIC_ABBR, CONVERSION.
Source
Conversion table.
Reference table - diameter 2-inch class codes (DIA).
Description
Table with min (MIN), max (MAX), and 2-inch class diameter codes (MEANING).
Format
A dataframe with 3 columns, MIN, MAX, and MEANING.
Source
Imported from comma-delimited file.
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - for generating tables.
Description
Table with row/column domain (VARNM) and their pretty names for table output (TABLENM).
Format
A dataframe with 2 columns, VARNM and TABLENM.
Source
FIA look-up table.
Reference table - FIESTA estimators.
Description
Table with list of estimators currently in FIESTA.
Format
A dataframe with 7 columns: ESTIMATOR, SHORTNAME, PACKAGE, OUTNAME, ESTIMATOR_TYPE, ESTIMATOR_DATA, DESCRIPTION, CITATION
Source
Comma-delimited file.
Reference table - for generating estimates
Description
Data frame with variable names and descriptions
Format
A data frame to use a reference for estimation variables and filters.
Reference table - for generating tables.
Description
Table with row/column domain (VARNM) and their pretty names for table output (TABLENM).
Format
A dataframe with 3 columns, EVAL_TYP_CD, EVAL_TYP, DESCRIPTION.
Source
FIA look-up table.
Reference table - Metadata for plt default variables output from DBgetPlots()
Description
Data frame with variable names and descriptions.
Format
A data frame with 43 rows and 3 columns VARIABLE - Variable in plt data frame DESCRIPTION - Description of variable in plt data frame TABLE - Table in database where variable originates or if derived
Source
FIA look-up table
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - popType codes.
Description
Table with population type (popType) and associated evaluation code (EVAL_TYP_CD).
Format
A dataframe with 2 columns, VARNM and TITLE.
Source
Comma-delimited file.
Reference table - Metadata for shp_* default variables output from DBgetPlots()
Description
Data frame with variable names and descriptions
Format
A dataframe with 63 rows and 4 columns VARIABLE - Variable in plt data frame DESCRIPTION - Description of variable in plt data frame TABLE - Table in database where variable originates or if derived SHPEXPORT - Name of variable for exported shapefile (<= 10 characters)
Source
FIA look-up table
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - Code definitions.
Description
Table with species information downloaded from datamart FIADB_REFERENCES, subset from REF_SPECIES TABLE.
Format
A dataframe with 14 columns: SPCD, COMMON_NAME, GENUS, SPECIES, SPECIES_SYMBOL, E_SPGRCD, W_SPGRPCD, C_SPGRPCD, P_SPGRPCD, MAJOR_SPGRPCD, JENKINS_TOTAL_B1, JENKINS_TOTAL_B2, DRYWT_TO_GREENWT_CONERSION, SCIENTIFIC_NAME (GENUS + SPECIES).
Source
Imported from comma-delimited file.
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - state codes (STATECD).
Description
Table with state codes (VALUE), name (MEANING), abbreviation (ABBR), and UNIT.
Format
A dataframe with 4 columns, VALUE, MEANING, ABBR, UNIT.
Source
Imported from comma-delimited file.
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - Variable titles.
Description
Table with variable name (VARNM) and associated title (TITLE).
Format
A dataframe with 2 columns, VARNM and TITLE.
Source
Comma-delimited file.
Reference table - Metadata for tree default variables output from DBgetPlots()
Description
Data frame with variable names and descriptions
Format
A data frame with 72 rows and 3 columns VARIABLE - Variable in tree data frame DESCRIPTION - Description of variable in tree data frame TABLE - Table in database where variable originates
Source
FIA look-up table
References
O'Connell, B.M.; LaPoint, E.B.; Turner, J.A.; Ridley, T.; Boyer, D.; Wilson, A.M.; Waddell, K.L.; Christensen, G.; Conkling, B.L. 2012. The Forest Inventory and Analysis Database: Database Description and Users Manual Version 5.1.2 for Phase 2. U.S. Department of Agriculture. (http://fia.fs.fed.us/library/database-documentation/current/ver5-2012/FIADB_user manual_5-1-2_p2_07_2012.pdf)
Reference table - for variable units.
Description
Table with units for TREE variables. The WOODLAND column was added to identify which variables include woodland species.The kg2tons column was added to identify which variables are commonly converted from kilograms to tons in estimation process.
Format
A dataframe with 4 columns: VARIABLE, UNITS, METRICUNITS, WOODLAND, kg2tons.
Source
Units table.
Data saving options.
Description
Returns a list of user-supplied parameters and parameter values for saving data.
Usage
savedata_options(
outfolder = NULL,
out_fmt = "csv",
outsp_fmt = "shp",
outobj_fmt = "rds",
out_dsn = NULL,
out_layer = "outdat",
outfn.pre = NULL,
outfn.date = FALSE,
addtitle = TRUE,
raw_fmt = "csv",
raw_dsn = NULL,
overwrite_dsn = FALSE,
overwrite_layer = TRUE,
append_layer = FALSE,
add_layer = TRUE,
layer.pre = NULL,
outconn = NULL,
...
)
Arguments
outfolder |
String. The outfolder to write files to. If NULL, files are written to working directory, or if gui=TRUE, a window to browse. |
out_fmt |
String. Format for output tables ('csv', 'sqlite', 'gpkg', 'gdb'). |
outsp_fmt |
String. Format for output spatial ('shp', sqlite', 'gpkg', 'gdb'). |
outobj_fmt |
String. Format for output spatial ('rda', 'rds', 'llo'). |
out_dsn |
String. Data source name for output. If extension is not included, out_fmt is used. Use full path if outfolder=NULL. |
out_layer |
outlayer. |
outfn.pre |
String. If savedata=TRUE, prefix for output files. If rawdata=TRUE, prefix for rawdata files (if raw_fmt = 'csv') or raw_dsn (if raw_fmt != 'csv'). |
outfn.date |
Logical. If TRUE, add current date to out_dsn. |
addtitle |
Logical. If TRUE and savedata=TRUE, adds title to outfile. |
raw_fmt |
String. Format for output rawdata tables ('sqlite', 'gpkg', 'csv', 'gdb'). |
raw_dsn |
String. Data source name for rawdata output. If extension is not included, out_fmt is used. Use full path if outfolder=NULL. |
overwrite_dsn |
Logical. If TRUE, overwrites raw_dsn, if exists. |
overwrite_layer |
Logical. If TRUE, overwrites the output. If rawdata=TRUE, overwrites out_layer in rawdata folder (if raw_fmt = 'csv') or out_layers in raw_dsn (if raw_fmt != 'csv'). |
append_layer |
Logical. If TRUE, and appends data to existing *.csv files (if *_fmt = 'csv') or *_dsn layers (if *_fmt != 'csv". |
add_layer |
Logical. If TRUE, adds layer to an existing out_dsn (if out_fmt != c('csv','shp')). |
layer.pre |
Layer prefix. |
outconn |
Open database connection to save to. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for saving data.
Author(s)
Grayson W. White
Examples
savedata_options(outfolder = "path", overwrite_dsn = FALSE)
Make SpatialPoints options
Description
Returns a list of user-supplied parameters and parameter values for making SpatialPoints.
Usage
spMakeSpatial_options(
xvar = NULL,
yvar = NULL,
xy.crs = 4269,
prj = NULL,
datum = NULL,
zone = NULL,
zoneS = FALSE,
aea.param = "USGS",
...
)
Arguments
xvar |
String. Name of variable in xyplt defining x coordinate. |
yvar |
String. Name of variable in xyplt defining y coordinate. |
xy.crs |
PROJ.4 String or CRS object or Integer EPSG code defining Coordinate Reference System. (e.g., EPSG:4269-Geodetic coordinate system for North America, NAD83). |
prj |
String. Projection, or coordinate system of the X/Y coordinates ("longlat", "utm", "aea"). If other, include PROJ.4 string in prj4str. |
datum |
String. Datum of projection ("WGS84", "NAD83", "NAD27"). |
zone |
Integer. If prj="utm", the UTM zone. |
zoneS |
Logical. If prj="utm", if the UTM zone is in the Southern hemisphere. |
aea.param |
String. If prj="aea", the associated lat/lon parameters (USGS: " +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0"). If other, include PROJ.4 string in prj4str. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for strata.
Author(s)
Grayson W. White
Examples
spMakeSpatial_options()
Spatial Data Functions
Description
These functions allow for analysis and manipulation of spatial data. Tasks include but are not limited to analyzing polygons, comparing projections, and checking data compatibility.
Usage
polyfix.sf(x, nolonglat = TRUE)
build.prj4str(
prj,
datum = NULL,
ellps = NULL,
zone = NULL,
zoneS = FALSE,
aea.param = "USGS",
gui = FALSE
)
trunc10shp(x)
merge_extents(layer1, layer2)
check.extents(
bbox1,
bbox2,
showext = FALSE,
layer1nm = NULL,
layer2nm = NULL,
stopifnotin = FALSE,
quiet = FALSE
)
getprjatt(prj4str, prjatt, stopifnull = FALSE)
areacalc.poly(
polyv,
polyv_dsn = NULL,
areaprj = "aea",
zone = NULL,
unit = "ACRES",
areavar = NULL
)
checksf.longlat(x, nolonglat = TRUE, crs.default = NULL)
crsCompare(
x,
ycrs = NULL,
x.crs = NULL,
nolonglat = FALSE,
checkonly = FALSE,
crs.default = NULL
)
sf_dissolve(sflayer, col = NULL, areacalc = TRUE)
closest_poly(x.centroid, ypoly, ypoly.att = NULL, nbr = NULL, returnsf = TRUE)
getIntersect(layer1, layer2, layer1.unique, layer2fld, overlapThreshold = 0)
clip.othertables(
inids,
othertabnms,
othertabs = NULL,
uniqueid = "PLT_CN",
savedata = FALSE,
outfn.pre = NULL,
outfolder = NULL,
out_fmt = "csv",
out_dsn = NULL,
outfn.date = FALSE,
overwrite_layer = FALSE,
gui = FALSE
)
check.area(bnd, bnd_dsn, bnd.att = NULL, areaunits = "acres", min.area = 6000)
Details
These functions carry out spatial data analysis.
Value
Spatial data object from 'sf'. Used for spatial data analyses.
Author(s)
Tracey S. Frescino
Strata options.
Description
Returns a list of user-supplied parameters and parameter values for strata.
Usage
strata_options(
getwt = FALSE,
getwtvar = "P1POINTCNT",
strwtvar = "strwt",
stratcombine = TRUE,
minplotnum.strat = 2,
pivot = FALSE,
nonresp = FALSE,
...
)
Arguments
getwt |
Logical. If TRUE, calculates strata weights from stratatlut getwtvar. If FALSE, strwtvar variable must be in stratalut. |
getwtvar |
String. If getwt=TRUE, name of variable in stratalut to calculate weights (Default = 'P1POINTCNT'). |
strwtvar |
String. If getwt=FALSE, name of variable in stratalut with calculated weights (Default = 'strwt'). |
stratcombine |
Logical. If TRUE, and strata=TRUE, automatically combines strata categories if less than minplotnum.strat plots in any one stratum. See notes for more info. |
minplotnum.strat |
Integer. Minimum number of plots for a stratum within an estimation unit. |
pivot |
Logical. If TRUE, pivot stratalut. |
nonresp |
Deprecated. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for strata.
Author(s)
Grayson W. White
Examples
strata_options(getwt = FALSE)
SpatialPolygonsDataFrame with FIA state, unit, county codes and names
Description
Polygon feature class with state and county boundaries defined by Census Bureau, including Federal Information Processing Standards (FIPS) codes. The FIA Survey Unit code and name attributes (UNITCD, UNITNM) were appended to dataset, with joining columns of STATECD and COUNTYCD.
Format
A SpatialPolygonsDataFrame with 3233 features and 8 attributes RS - FIA Research Station name RSCD - FIA Research Station code STATECD - FIPS state code STATENM - FIPS state name STATEAB - FIPS state abbreviation UNITCD - FIA survey unit code UNITNM - FIA survey unit name COUNTYCD - FIPS county code COUNTYNM - FIPS county name
Details
Derived from cb_2018_us_county_5m. STATEFP was converted to numeric and named STATECD COUNTYFP was converted to numeric and named COUNTYCD Lookup table for FIA Research Station (REF_RESEARCH_STATION) was downloaded from FIA DataMart on 20191105 (FIADB_1.6.1.00) and joined by STATECD. A lookup table for UNITCD was created from plot data using unique STATECD, COUNTYCD, UNITCD and joined to table.
Converted to simple feature
Transformed CRS from longlat(EPSG:4269) to
Albers (EPSG:5070)
Saved to R object, with compression='xz'
Source
Downloaded from the United States Census Bureau on 2019 November 3, format Esri Shapefile (https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html) Projection: Geographic (GCS_North_American_1983) EPSG: 4269
List of FIADB table unique IDs.
Description
Returns a list of user-supplied parameters and parameter values for data table unique IDs to be supplied to *pop functions.
Usage
tableIDs(
cond = "PLT_CN",
plt = "CN",
tree = "PLT_CN",
seedling = "PLT_CN",
subplot = "PLT_CN",
subp_cond = "PLT_CN",
condid = "CONDID",
subpid = "SUBP",
...
)
Arguments
cond |
String. Unique identifier of plot in cond. |
plt |
String. Unique identifier of plot in plt. |
tree |
String. Unique identifier of plot in tree. |
seedling |
String. Unique identifier of plot in seedling. |
subplot |
String. Unique identifier of plot in subplot. |
subp_cond |
String. Unique identifier of plot in subp_cond. |
condid |
String. Unique identifier of a condition in cond. |
subpid |
String. Unique identifier of a subplot in subplot and subp_cond. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied unique identifier of a plot in tables.
Author(s)
Tracey S. Frescino
Table aesthetics and output options.
Description
Returns a list of user-supplied parameters and parameter values for outputting tables with custom aesthetics.
Usage
table_options(
row.FIAname = FALSE,
col.FIAname = FALSE,
row.orderby = NULL,
col.orderby = NULL,
row.add0 = FALSE,
col.add0 = FALSE,
rowlut = NULL,
collut = NULL,
row.classify = NULL,
col.classify = NULL,
rawonly = FALSE,
raw.keep0 = FALSE,
rowgrp = FALSE,
rowgrpnm = NULL,
rowgrpord = NULL,
totals = TRUE,
allin1 = FALSE,
metric = FALSE,
estround = 1,
pseround = 2,
estnull = "--",
psenull = "--",
row.NAname = "Other",
col.NAname = "Other",
divideby = NULL,
spcdname = "COMMON_SCIENTIFIC",
...
)
Arguments
row.FIAname |
Logical. If TRUE, retrieves default FIA reference names for rowvar located in ref_codes data frame. Names are only available for certain variables (Check sort(unique(ref_codes$VARIABLE)) for available names. If row.FIAname = TRUE and rowvar is in ref_codes, the rowvar name is used for the output table, and the rowvar code is used to sort. |
col.FIAname |
Logical. If TRUE, retrieves default FIA reference names for colvar located in ref_codes data frame. Names are only available for certain variables. Check: sort(unique(ref_codes$VARIABLE)) for available names. If col.FIAname = TRUE and rowvar is in ref_codes, the colvar name is used for the output table, and the colvar code is used to sort. |
row.orderby |
String. Optional. Name of variable to sort table rows. Both the rowvar and row.orderby variables must be included in the same input data.frame. if NULL, and row.FIAname=FALSE or rowvar is not in ref_codes, the rows are ordered by rowvar. |
col.orderby |
String. Optional. Name of variable to sort table columns. Both the colvar and col.orderby variables must be included in the same input data.frame. if NULL, and col.FIAname=FALSE or colvar is not in ref_codes, the columns are ordered by colvar. |
row.add0 |
Logical. If TRUE, include rows with 0 values to the output table. |
col.add0 |
Logical. If TRUE, include columns with 0 values to the output table. |
rowlut |
Data frame. A lookup table with variable codes and code names to include as rows of output table (See notes for more information and format). |
collut |
Data frame. A lookup table with variable codes and code names to include as columns of output table (See notes for more information and format). |
row.classify |
Data frame (if categorical) or Vector (if continuous). If clasifying categories, input a dataframe with two columns. The columns must be named 'FROM' and 'TO', or include the rowvar and the classified column name. If classifying continuous values, input a vector of class breaks for row values (e.g., c(0,25,50): >=0 and < 25 (0-25); >=25 and <50 (25-50), >=50 (50+)). |
col.classify |
Data frame (if categorical) or Vector (if continuous). If clasifying categories, input a dataframe with two columns. The columns must be named 'FROM' and 'TO', or include the colvar and the classified column name. If classifying continuous values, input a vector of class breaks for row values (e.g., c(0,25,50): >=0 and < 25 (0-25); >=25 and <50 (25-50), >=50 (50+)). |
rawonly |
Logical. If TRUE, only rawdata are output. If dataset includes many estimation units, and only raw data tables are desired, it is more efficient to output raw data only. |
raw.keep0 |
Logical. If TRUE, keep 0 values in raw data tables. |
rowgrp |
Logical. If TRUE, appends row groups to first column of table. Only available if group category exists in ref_codes table or defined in rowgrpnm (e.g., FORTYPGRPCD, OWNGRPCD). |
rowgrpnm |
String. Name of variable for grouping rowvar. Variable must be included in same input table as rowvar. |
rowgrpord |
String. Name of variable to sort row group variable. Variable must be included in same input table as rowgrpnm. |
totals |
Logical. If TRUE, returns total estimate (mean * AREAUSED). |
allin1 |
Logical. If TRUE, both estimates and percent sample error are output in one table as: estimates (percent sample error). |
metric |
Logical. If TRUE, output if returned in metric units. |
estround |
Integer. Number of decimal places for estimates. |
pseround |
Integer. Number of decimal places for percent sampling error. |
estnull |
Number or character. The number or symbol to use to indicate 'not sampled' for estimate. |
psenull |
Number or character. The number or symbol to use to indicate 'not sampled' for percent standard error. |
row.NAname |
String. The name to use for NA values for rows. |
col.NAname |
String. String. The name to use for NA values for columns. |
divideby |
String. Conversion number for output ('hundred', 'thousand', 'million'). |
spcdname |
String. Type of name to use for species in tables ('COMMON', 'SCIENTIFIC', SYMBOL', 'COMMON_SCIENTIFIC', 'NONE'). |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for outputting tables with custom aesthetics.
Author(s)
Grayson W. White
Examples
table_options(row.FIAname = TRUE, col.FIAname = TRUE)
Title output options.
Description
Returns a list of user-supplied parameters and parameter values for outputting title with custom aesthetics.
Usage
title_options(
title.main = NULL,
title.ref = NULL,
title.rowvar = NULL,
title.colvar = NULL,
title.unitvar = NULL,
title.estvar = NULL,
title.estvarn = NULL,
title.filter = NULL,
title.units = "acres",
...
)
Arguments
title.main |
String. TITLE, if savedata=TRUE and/or returntitle=TRUE: the complete title used for table. If title.main=NULL, the title.* parameters are used to generate title string. Note: if title.ref is not NULL, it is added to title.main. |
title.ref |
String. TITLE, if savedata=TRUE and/or returntitle=TRUE: the ending text of the table title (e.g., Nevada, 2004-2005). If NULL, = "". |
title.rowvar |
String. TITLE, if savedata=TRUE and/or returntitle=TRUE: pretty name for the row domain variable. If NULL, = rowvar. |
title.colvar |
String. TITLE, if savedata=TRUE and/or returntitle=TRUE: pretty name for the column domain variable. If NULL, = colvar. |
title.unitvar |
String. TITLE, if savedata=TRUE and/or returntitle=TRUE: pretty name for the estimation unit variable. If NULL, = unitvar. |
title.estvar |
String. TITLE: if savedata=TRUE and/or returntitle=TRUE: pretty name for the estimate variable. If NULL, title.estvar = estvar.name. |
title.estvarn |
String. TITLE: if savedata=TRUE and/or returntitle=TRUE: pretty name for the estimate variable. If NULL, title.estvar = estvar.name. |
title.filter |
String. TITLE, if savedata=TRUE and/or returntitle=TRUE: pretty name for filter(s). If title.filter=NULL, a default is generated from cfilter. If title.filter="", no title.filter is used. |
title.units |
String. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for outputting titles with custom aesthetics.
Author(s)
Grayson W. White
Examples
title_options(title.main = "My fancy title", title.estvar = "Estimate title")
Unit options.
Description
Returns a list of user-supplied parameters and parameter values for unit.
Usage
unit_options(
unitvar2 = NULL,
areaunits = "acres",
minplotnum.unit = 10,
unit.action = "keep",
npixelvar = "npixels",
...
)
Arguments
unitvar2 |
String. Name of a second level estimation unit variable in unitarea and cond or pltassgn with assignment for each plot (e.g., 'STATECD'). |
areaunits |
String. Units of areavar in unitarea ('acres', 'hectares'). |
minplotnum.unit |
Integer. Minimum number of plots for estimation unit. |
unit.action |
String. What to do if number of plots in an estimation unit is less than minplotnum.unit ('keep', 'remove' 'combine'). If unit.action='keep', estimation units with less that minplotnum.unit will be kept in output tables; if unit.action='remove', the estimation units with less that minplotnum.unit will be removed from the output tables; and if unit.action='combine', combines estimation unit to the following estimation unit, ordered in stratalut or unitzonal. |
npixelvar |
String. Name of variable in unitlut defining number of pixels by estimation unit. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for strata.
Author(s)
Grayson W. White
Examples
unit_options()
Data Writing Functions
Description
These functions allow for data to be written to different formats. Currently, supported formats are "csv" and "sqlite".
Usage
write2csv(
layer,
lowernames = FALSE,
outfile = NULL,
outfolder = NULL,
outfilenm = NULL,
outfn.pre = NULL,
outfn.date = FALSE,
overwrite = FALSE,
tabtitle = NULL,
appendfile = FALSE,
closefn = TRUE,
outtxt = NULL,
gui = FALSE
)
write2postgresql(
layer,
dbconn,
out_name = NULL,
lowernames = TRUE,
schema = NULL,
append_layer = FALSE,
overwrite = FALSE,
index.unique = NULL,
index = NULL,
index_type = "btree"
)
write2sqlite(
layer,
SQLitefn = NULL,
out_name = NULL,
lowernames = FALSE,
gpkg = FALSE,
outfolder = NULL,
overwrite = FALSE,
append_layer = FALSE,
createnew = FALSE,
dbconn = NULL,
dbconnopen = FALSE,
index.unique = NULL,
index = NULL
)
Details
These functions allow for data to be written to different formats.
Value
No return value, writes data to either a "csv" or "sqlite" file.
Author(s)
Tracey S. Frescino
List of population tables.
Description
Returns a list of user-supplied parameters and parameter values for data xyuation (FIA or custom) extraction to be supplied to *DB functions.
Usage
xy_options(
xy.uniqueid = "CN",
xvar = "LON",
yvar = "LAT",
xy.crs = 4269,
xyjoinid = NULL,
...
)
Arguments
xy.uniqueid |
String. Unique identifier of xy. |
xvar |
String. Name of variable in xy defining x coordinate. |
yvar |
String. Name of variable in xy defining y coordinate. |
xy.crs |
PROJ.4 String or CRS object or Integer EPSG code defining Coordinate Reference System. |
xyjoinid |
String. Name of variable in xy to join to plot data. If NULL, xyjoinid = xy.uniqueid. |
... |
For extendibility. |
Details
If no parameters, an empty list is returned.
Value
A list of user-supplied parameters and parameter values for strata.
Author(s)
Tracey S. Frescino
Examples
xy_options(xvar="LON", yvar="LAT")