The goal of timbeR is to provide functions for estimating log volumesand quantities from taper functions in the processing of forestinventories.
You can install the CRAN version of the package as follows:
install.packages("timbeR")You can also install the development version fromGitHub with:
# install.packages("devtools")devtools::install_github("sergiocostafh/timbeR")As a basic example, we can fit a 5th degree polynomial to thetree_scaling dataset.
library(dplyr)library(timbeR)tree_scaling<- tree_scaling%>%mutate(did = di/dbh,hih = hi/h)poli5<-lm(did~hih+I(hih^2)+I(hih^3)+I(hih^4)+I(hih^5),tree_scaling)And then we define the wood products:
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))And now we can estimate the volume and quantity of wood products in atree stem. For ease of understanding, let’s simulate cutting logs on asingle tree.
# Tree measurementsdbh<-25h<-20# Estimate logs volume and quantitypoly5_logs(dbh, h,coef(poli5), assortments)#> $volumes#> # A tibble: 1 x 2#> `15-25` `4-15`#> <dbl> <dbl>#> 1 0.293 0.111#>#> $logs#> # A tibble: 1 x 2#> `15-25` `4-15`#> <dbl> <dbl>#> 1 3 2Finally, we can generate the same result in a visual way, simulatingthe position of the logs along the tree stem.
poly5_logs_plot(dbh, h,coef(poli5), assortments)