NVEL_volume: Predict volume using National Volume Estimator Library (NVEL)

View source: R/NVEL_volume.R

NVEL_volumeR Documentation

Predict volume using National Volume Estimator Library (NVEL)

Description

Predict volume using National Volume Estimator Library (NVEL)

Usage

NVEL_volume(
  dfTL = data.frame(dbh = 5, ht = 5),
  voleq = NA,
  region = 1,
  forest = NA,
  district = NA,
  voleqNm = c("voleq"),
  regionNm = c("region"),
  forestNm = c("forest"),
  districtNm = c("district"),
  spcdNm = "spcd",
  dbhNm = "dbh",
  htNm = "ht",
  pulpDbNm = c("pulpDb"),
  sawDbNm = c("sawDb"),
  htPrd1Nm = c("htPrd1"),
  htPrd2Nm = c("htPrd2"),
  upHt1Nm = c("upHt1"),
  upDb1Nm = c("upDb1"),
  stumpHtNm = "stumpHt",
  fclassNm = c("fclass"),
  dbtbhNm = c("dbtbh"),
  btrNm = c("btr"),
  vol2biomass = T,
  dll_64 = "lib/vollib-64bits/vollib.dll",
  dll_32 = "lib/vollib-32bits/vollib.dll",
  load_dll = T,
  dll_func_vol = "vollib_r",
  dll_func_voleq = "getvoleq_r"
)

Arguments

dfTL

tree list with a minimum of diamter and height columns

voleq

force a specific volume equation for all trees

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

voleqNm

(optional) column name in DFTL: provide region, forest, district for every tree in dfTL

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

dbhNm

(required) column name in DFTL: dbh in inches

htNm

(required) column name in DFTL: height in feet

pulpDbNm

(optional) column name in DFTL: upper db miminum for pulp (in)

sawDbNm

(optional) column name in DFTL: upper db miminum for saw (in)

htPrd1Nm

(optional) column name in DFTL: Height to the minimum top diameter inside bark for primary product (ft)

htPrd2Nm

(optional) column name in DFTL: Height to the minimum top diameter inside bark for secondary product (ft)

upHt1Nm

(optional) column name in DFTL: Upper stem height in feet where upper stem diameter was measured or where AVG1 is to be applied. OR For Region 8 the upper stem reference height defined by their profile model (ht0, ht4, ht7, ht9). OR For region 9 the UPSHT1 is the height to 7.6/9.6 top diameter when HT1PRD is not the height to 7.6/9.6 top diameter.

upDb1Nm

(optional) column name in DFTL: Upper stem diameter measured at

stumpHtNm

(optional) column name in DFTL: stump height (ft)

fclassNm

(optional) column name in DFTL: Girard’s form class. Diameter at the top of the first log given as a percent of DBH.

dbtbhNm

(optional) column name in DFTL: Double bark thickness at breast height in inches

btrNm

(optional) column name in DFTL: Bark thickness ratio given as the percent of diameter inside bark to diameter outside bark. (dib/dob *100).

vol2biomass

T/F Compute total drye and green biomass in lbs using weight factors and append weight factors (lbs / cubic foot)

dll_64

path to 64bit dll

dll_32

path to 64bit dll

load_dll

T/F should dll be loaded (in case it is already loaded)

dll_func_vol

name of volume prediction function call in NVEL .dll

dll_func_voleq

name of volume equation chooser function call in NVEL .dll

nclus

number of cores to use

Details

Predict volume using National Volume Estimator Library (NVEL)

see: https://www.fs.fed.us/forestmanagement/products/measurement/volume/nvel/index.php


Revision History

1.0 5/19/2020 Implemented
1.1 5/21/2020 Add biomass and weight factors

Value

a data.frame reformatted to include all of the original columns, any missing columns for the NVEL .dll, 15 columns of predicted volumes, and an error column

predicted volumes: 1) Total Cubic Volume from ground to tip 2) Gross Scribner board foot volume. Note: The VOL(2) is International ¼ board foot volume for Region 8 Forest 8, 9, 10, and 12 (except Andrew Pickens district); and Region 9 Forest 4,5,8,11,12,14,19,20,21,22,24, and 30 when using Clark profile equation. 3) Net Scribner board foot volume. 4) Gross merchantable cubic foot volume 5) Net merchantable cubic foot volume 6) Merchantable cordwood volume 7) Gross secondary product volume in cubic feet 8) Net secondary product volume in cubic feet 9) Secondary product in cordwood 10) Gross International ¼ board foot volume 11) Net International ¼ board foot volume 12) Gross secondary product in Scribner board feet 13) Net secondary product in Scribner board feet 14) Stump volume 15) Tip volume

Author(s)

Jacob Strunk <Jacob.strunk@usda.gov>

See Also

NVEL_voleq

Examples


        #grab list of species
        if(!"dfSpp" %in% ls()){
          library(RSQLite)
          db0 = dbConnect(RSQLite::SQLite(), system.file("misc/NBEL/BiomassEqns.db", package="RSForInvt"))
          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_volume( dfTL = df_fake )




jstrunk001/RSForInvt documentation built on April 18, 2022, 11:03 p.m.