NVEL_biomass: Predict biomass using National Volume Estimator Library...

View source: R/NVEL_volume.R View source: R/NVEL_biomass.R

NVEL_biomassR Documentation

Predict biomass using National Volume Estimator Library (NVEL)

Description

Predict biomass using National Volume Estimator Library (NVEL)

Usage

NVEL_biomass()

Arguments

dfTL

tree list with a minimum of diamter and height columns

bioeq

(optional) use single equation for all trees

bioeqNm

(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

clNm

(optional) column name in DFTL: crown length in feet

merchDbNm

(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)

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_bioeq

name of volume equation chooser function call in NVEL .dll

nclus

number of cores to use

Details

Predict biomass 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

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

Author(s)

Jacob Strunk <Jacob.strunk@usda.gov>

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.