NVEL_voleq | R Documentation |
Select Appropriate Volume equation for Region, Forest, District, Tree species from National Volume Estimator Library (NVEL)
NVEL_voleq(
dfTL = list(NA, data.frame(spcd = 201, dbh = 5, ht = 5, region = 0, forest = "01",
district = "01"))[[1]],
region = NA,
forest = NA,
district = NA,
spcd = NA,
regionNm = "region",
forestNm = "forest",
districtNm = "district",
spcdNm = "spcd",
dll_64 = system.file("lib/VolLibDll20231106/vollib-64bits/vollib.dll", package =
"RForInvt"),
dll_32 = system.file("lib/VolLibDll20231106/vollib-32bits/vollib.dll", package =
"RForInvt"),
dll_func_voleq = "getvoleq_r",
load_dll = T
)
dfTL |
data.frame with tree records |
region |
(optional) region,forest,district but these supercede values in dfTL columns regionNm,forestNm, districtNm |
forest |
(optional) region,forest,district but these supercede values in dfTL columns regionNm,forestNm, districtNm |
district |
(optional) region,forest,district but these supercede values in dfTL columns regionNm,forestNm, districtNm |
regionNm |
(optional) column name in DFTL:provide region, forest, district for every tree in dfTL |
forestNm |
(optional) column name in DFTL:provide region, forest, district for every tree in dfTL |
districtNm |
(optional) column name in DFTL: provide region, forest, district for every tree in dfTL |
spcdNm |
(required) column name in DFTL: USFS species code |
dll_64 |
path to 64bit dll |
dll_32 |
path to 64bit dll |
dll_func_voleq |
name of volume equation chooser function call in NVEL .dll |
load_dll |
T/F should dll be loaded (in case it is already loaded) |
Select Appropriate Volume equation for Region, Forest, District, Tree species from National Volume Estimator Library (NVEL)
Revision History
1.0 | 5/19/2020 Function created |
reformatted tree list with with a new column volume equation codes for NVEL - "voleq"
Jacob Strunk <someone@somewhere.com>
NVEL_volume
NVEL_biomass
#look up volume equations
library(RSForInvt)
NVEL_voleq(region = 2, forest = "01",district = "01", spcd=951)
NVEL_voleq(region = 2, forest = "01",district = "01", spcd=951)
NVEL_voleq(region = 2, forest = "01",district = "01", spcd=rep(c(951,201),2))
NVEL_voleq(dfTL=data.frame(region = 6, forest = "01",district = "01", spcd=rep(c(951,201),2)))
#grab list of species
if(!"dfSpp" %in% ls()){
library(RSQLite)
db0 = dbConnect(RSQLite::SQLite(), "code/BiomassEqns.db")
dfSpp = dbGetQuery(db0, paste("select * from tblspp"))
dfCoeff = dbGetQuery(db0, paste("select * from BM_EQCoefs"))
dbDisconnect(db0)
}
#build a fake tree list
if(!"dfSpp" %in% ls()){
set.seed=111
nfake=length(unique(dfCoeff$species_code))
df_fake = data.frame(
trid=1:(nfake)
,region = 6
,forest = "01"
,district = "01"
,dbh=10*abs(rnorm(nfake))
,ht=100*abs(rnorm(nfake))
,spcd = unique(dfCoeff$species_code)#' sample(c("a","b","c","d") , nfake , T)
)
}
#get volumes
NVEL_voleq( dfTL = df_fake )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.