bi_logs_plot {timbeR} | R Documentation |
Visualize the simulation of log cutting along the stem using a Bi (2000) variable-form taper equation.
Description
Plot the shape of the tree and visualize the extracted logs based on the tree measurements, assortments data.frame, and the Bi (2000) variable-form taper equation.
Usage
bi_logs_plot(
dbh,
h,
coef,
assortments,
stump_height,
downgrade,
broken,
defect_height,
lang
)
Arguments
dbh |
tree diameter at breast height, in centimeters. |
h |
total tree height, in meters. |
coef |
numerical vector containing seven coefficients of the Bi variable-form taper equation. |
assortments |
a data.frame with five columns and n rows, where n is the number of different wood assortments to be obtained from the tree stem. The first column must contain the names of the assortments, the second, numerical, contains the minimum diameters at the small end of the logs, in centimeters. The third column, numerical, contains the minimum lengths of the logs, in meters. The fourth column, numerical, contains the maximum lengths of the logs, in meters. The fifth column, numerical, contains the values in centimeters referring to the loss of wood due to cutting logs. The algorithm prioritizes the extraction of assortments along the stem in the order presented in the data.frame, starting from the first line, to the last. |
stump_height |
tree cutting height, in meters. Default is 0. |
downgrade |
if TRUE, the algorithm,from the defect_height onwards, simulates log extraction only for the last assortment in the assortments data.frame. Default is FALSE. |
broken |
if TRUE, the algorithm will simulate the extraction of logs only up to the defect_height. Default is FALSE. |
defect_height |
the height, in meters, from which the logs will be downgraded (if downgrade is TRUE) or log extraction simulation will be stopped (if broken is TRUE). Default is h * 0.5. |
lang |
language in which plot labels will be displayed. Current options are 'en' and 'pt-BR'. Default is 'en'. |
Details
check the bi_logs
function help for more details.
Value
a ggplot object.
Examples
library(dplyr)
library(minpack.lm)
library(timbeR)
tree_scaling <- tree_scaling %>%
mutate(did = di/dbh,
hih = hi/h)
bi <- nlsLM(di ~ taper_bi(dbh, h, hih, b0, b1, b2, b3, b4, b5, b6),
data=tree_scaling,
start=list(b0=1.8,b1=-0.2,b2=-0.04,b3=-0.9,b4=-0.0006,b5=0.07,b6=-.14))
coef_bi <- coef(bi)
dbh <- 25
h <- 20
assortments <- data.frame(
NAME = c('15-25','4-15'),
SED = c(15,4),
MINLENGTH = c(2.65,2),
MAXLENGTH = c(2.65,4.2),
LOSS = c(5,5)
)
bi_logs_plot(dbh, h, coef_bi, assortments)