diameter_class {forestmangr} | R Documentation |
Divide data into diameter classes, and get number of observations
Description
This function can be used to divide data into diameter classes, get the number of observations, number of observations per ha, and check number of species individuals, volume and G in each diameter class. It's also possible to spread the diameter classes as columns.
Usage
diameter_class(
df,
dbh,
plot = NA,
plot_area,
ci = 5,
dbhmin = 5,
species = NA,
volume = NA,
NI_label = "NI",
cc_to_column = FALSE,
G_to_cc = FALSE,
cctc_ha = TRUE,
keep_unused_classes = FALSE
)
Arguments
df |
A data frame. |
dbh |
Quoted name of the diameter at breast height variable, in cm. |
plot |
Optional parameter.Quoted name of the plot variable. used to differentiate the plots trees, and calculate the number of sampled plots. Default |
plot_area |
Optional parameter. Quoted name of the plot area variable, or a numeric vector with the plot area value. The plot area value must be in square meters. Default |
ci |
Numeric value for the class interval used to classify the data. Default: |
dbhmin |
Numeric value for minimum diameter value to be considered in the classifications. dbh values smaller than this will be dismissed from the classification. Default: |
species |
Optional parameter. Quoted name of the scientific names variable, or any variable used to differentiate the different species found in data. If supplied, will be used to classify the species in the diameter data. Default |
volume |
Optional parameter. Quoted name of the volume variable. If supplied, will be used classify the volume variable in the different diameter classes. Also, if |
NI_label |
Label used for Species not identified. This parameter works along with species. The level supplied here will not be considered in the classification. Default |
cc_to_column |
If |
G_to_cc |
If |
cctc_ha |
If |
keep_unused_classes |
Some diameter classes may end up empty, depending on the maximum value of diameter and the class interval used. If this is |
Value
A data frame containing the supplied data divided into diameter classes.
Author(s)
Sollano Rabelo Braga sollanorb@gmail.com
Examples
library(forestmangr)
data("exfm20")
head(exfm20)
# n
# Number of individuals per ha per diameter class
diameter_class(df = exfm20, dbh = "dbh", ci = 10, dbhmin = 10, volume = "vol")
# Number of individuals per ha per diameter class per species
diameter_class(exfm20,"dbh", "transect", 10000, 10, 10, "scientific.name") %>%
head(10)
# Number of individuals per ha per diameter class, with each diameter class as a column
diameter_class(exfm20,"dbh", "transect", 10000, 10, 10, "scientific.name", cc_to_column=TRUE) %>%
head(10)
# G
# Basal area per ha per diameter class, with each diameter class as a column
diameter_class(exfm20,"dbh", "transect",10000,10,10,"scientific.name",
cc_to_column=TRUE,G_to_cc=FALSE) %>%
head(10)
# Volume
# Volume per ha per diameter class
diameter_class(exfm20,"dbh", "transect", 10000, 10, 10, "scientific.name",volume = "vol") %>%
head(10)
# Volume per ha per diameter class, with each diameter class as a column
diameter_class(exfm20,"dbh","transect",10000,10,10,"scientific.name","vol",cc_to_column=TRUE) %>%
head(10)