View source: R/vol_summarise.R
vol_summarise | R Documentation |
This function can be used to summarize volume with and without bark of trees in a data frame.
vol_summarise(df, dbh, th, vwb, tree, .groups = NA, vwob = NA)
df |
A data frame. |
dbh |
Quoted name of the diameter at breast height variable, in cm. |
th |
Quoted name of the total height variable, in meters. |
vwb |
Quoted name of the volume with bark variable, in cubic meters. |
tree |
Quoted name of the tree variable. used to differentiate the trees' sections. If this argument is |
.groups |
Optional argument. Quoted name(s) of additional grouping variables that can be added to differentiate subdivisions of the data. |
vwob |
Optional argument. Quoted name of the volume without bark variable, in cubic meters. Default: |
A data frame summarized by the .groups variable(s).
Sollano Rabelo Braga sollanorb@gmail.com
Complementary functions:
smalianwb
, For calculation of volume with bark using the Smalian method,
smalianwob
, For calculation of volume without bark using the Smalian method,
huberwb
, for calculation of volume with bark using the Huber method,
huberwob
, for calculation of volume without bark the Huber method.
library(forestmangr)
data("exfm7")
head(exfm7)
# In order to calculate the volume of each tree, first we
# Calculate the volume by tree section using the Smalian method:
sec_data_vol <- exfm7 %>%
smalianwb("di_wb", "hi", "TREE") %>%
smalianwob("di_wb", "hi", "bark_t", "TREE", bt_mm_to_cm = TRUE)
sec_data_vol
# Now, we summarize the tree's volume:
vol_summarise(sec_data_vol, dbh = "DBH", th = "TH", vwb = "VWB",
tree = "TREE", .groups = "STRATA",vwob = "VWOB")
# It's possible to do everything using pipes:
exfm7 %>%
smalianwb("di_wb", "hi", "TREE") %>%
smalianwob("di_wb", "hi", "bark_t", "TREE", bt_mm_to_cm = TRUE) %>%
vol_summarise("DBH", "TH", "VWB", "TREE", "STRATA", "VWOB")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.