DiamClass | R Documentation |
This function assigns each tree a diameter class
DiamClass(Tree, DBH, Convert = FALSE, Binwidth = 1)
Tree |
The Tree ID for each Tree. |
DBH |
The unique Plot ID for each Plot. |
Convert |
Change units from metric to English |
Binwidth |
Size of bins for diameter classes |
This function will return a diameter class value for each tree. If the data is in metric for other parts of the analysis, but will be finallyu reported in english, set Convert to TRUE, otherwise it will return values in the unit supplied. Binwidth determines the binwidth for the diameter classes. The default value is one but the bin width can be changed to whatever is desired.
Class sizes will use (bin1 + bin2)/2 as the break between bins. for example if binwidth is 2, all values greater than (3 + 5)/2 will be 5, etc.
This function is primarily for visualizing diameter distributions. Useful for examining stand structure and exploring appropriate silvicultural treatments. Maximum bin = 100.
The first bin will always have a value of 1.
Returns diameter class for each tree
Tree <- seq(1,15,1) DBH <- c(10,13,5,16,7,10,1,44,4,7,30,70,18,15,18) data <- data.frame(Tree, DBH) mapply(DiamClass,data$Tree, data$DBH) mapply(DiamClass,data$Tree, data$DBH, TRUE) mapply(DiamClass,data$Tree, data$DBH, Binwidth = 2) mapply(DiamClass,data$Tree, data$DBH, TRUE, 3) mapply(DiamClass,data$Tree, data$DBH, Binwidth = 5) mapply(DiamClass,data$Tree, data$DBH, Convert = TRUE, Binwidth = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.