DBHFuns: A variety of plot level diameter metrics for even and uneven...

View source: R/DiamFunctions.R

DBHFunsR Documentation

A variety of plot level diameter metrics for even and uneven aged stands

Description

This function defaults to plot level QMD. To change metric enter QMD = FALSE and METRICOFINTEREST = TRUE. Only a single metric may be calculated and output at one time. The function can calculate either QMD, the weighted mean, the mean diameter of largest 100 trees, the mean diameter of each species, or the mean diameter of a single species with all other trees being lumped into a single diameter group - all at the plot level. This lst metric can be useful when looking at relative importance of a single species or for any species specific analysis.

Usage

DBHFuns(
  Stand,
  Plot,
  Tree,
  DBH,
  EXPF = NA,
  SPP = NA,
  QMD = TRUE,
  TrueMean = FALSE,
  PlotLargest = FALSE,
  AllSpeciesDiam = FALSE,
  SpecificSPP = FALSE,
  InterestSPP = NA
)

Arguments

Stand

Unique Stand ID for each stand in your dataset. Can be set to 1 if only one stand is of interest.

Plot

Unique Plot ID for each Plot. Use Unique.ID function to ensure plot numbers are not recycled between stands.

Tree

Unique Tree ID.

DBH

Diameter at Breast Height (cm)

EXPF

Expansion factor of each tree. See EXP.F function.

SPP

FVS Species code for each tree. Defaults to NA. Is only necessary for Species Specific Diameter and Interest SPP outputs.

QMD

Plot level Quadratic Mean Diameter. Default Output. Defaults to TRUE and must be set as FALSE to use another metric.

TrueMean

True weighted mean diameter for each plot. Defaults to FALSE.

PlotLargest

Mean value of 100 largest diameter trees in plot. Defaults to FALSE.

AllSpeciesDiam

Provides weighted mean of diameter for each species in plot. requires entry of SPP diameter. Defaults to FALSE.

SpecificSPP

Obtain the weighted mean of a specific species' diameters and the weighted mean of all the other species combined. Requires a InterestSPP be named. Defaults to FALSE.

InterestSPP

The SPP that will be singled out for analysis using the SpecificSPP option in this function.

Details

All of these functions are meant to provide different tools for plot level diameter metrics.

This function uses the dplyr package to select, arrange, and mutate the data.

This function defaults to plot level QMD. To change metric enter QMD = FALSE and METRICOFINTEREST = TRUE.

Only a single metric may be calculated and output at one time.

Your data should include unique IDs specific to each plot. If you have not done this, it can be done using the Unique.ID function included in this package.

Value

The function returns a vector of length n with the descriptive metric chosen by the user.

Author(s)

Ryan Smith and Brian Smith

See Also

Unique.ID

EXP.F

Other Plot Level Functions: BA.Larger.Trees(), BAPH(), CCF.Larger(), CrownCompF(), HeightPredict(), RD(), SDI.Max(), SDI.Plot(), TPH(), TallestTrees(), Unique.ID()

Examples


## Not run: 
 ###### RUNNING THE SCRIPT ######
 ###### REQUIRES FULL VECTORS #####
 ###### AS SEEN HERE ######
 Stand <- c(1,1,1,1,rep(2,5))
 Plot <- c(1,1,1,1,3,3,4,4,4)
 Tree <- c(1:9)
 DBH <- seq(10, 18, 1)
 EXPF <- c(13,22,16,12,7,12,34,7,11)
 SPP <- c("WP", "WP", rep("RO", 7))

 DBHFuns(Stand, Plot, Tree, DBH, EXPF, SPP) # provides QMD
 DBHFuns(Stand, Plot, Tree, DBH, EXPF, SPP, QMD = FALSE, TrueMean = TRUE)
 DBHFuns(Stand, Plot, Tree, DBH, EXPF, SPP, QMD = FALSE, PlotLargest = TRUE)
 DBHFuns(Stand, Plot, Tree, DBH, EXPF, SPP, QMD = FALSE, AllSpeciesDiam = TRUE)
 DBHFuns(Stand, Plot, Tree, DBH, EXPF, SPP, QMD = FALSE, SpecificSPP = TRUE, InterestSPP = "WP")


## End(Not run)



ryanmismith/inventoryfunctions documentation built on Aug. 5, 2022, 2:22 a.m.