Learn R Programming

timbeR

The goal of timbeR is to provide functions for estimating log volumes and quantities from taper functions in the processing of forest inventories.

Installation

You can install the CRAN version of the package as follows:

install.packages("timbeR")

You can also install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("sergiocostafh/timbeR")

Example

As a basic example, we can fit a 5th degree polynomial to the tree_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 a tree stem. For ease of understanding, let’s simulate cutting logs on a single tree.

# Tree measurements
dbh <- 25
h <- 20

# Estimate logs volume and quantity
poly5_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      2

Finally, we can generate the same result in a visual way, simulating the position of the logs along the tree stem.

poly5_logs_plot(dbh, h, coef(poli5), assortments)

Copy Link

Version

Install

install.packages('timbeR')

Monthly Downloads

183

Version

2.0.1

License

MIT + file LICENSE

Maintainer

Sergio Costa

Last Published

April 11th, 2022

Functions in timbeR (2.0.1)

bi_di

Estimate the diameter at a given height based on a fitted Bi (2000) taper equation.
kozak_hi

Estimate the height at which a given diameter occurs in a tree, based on a fitted Kozak (2004) taper equation.
bi_logs

Simulate log extraction using a Bi (2000) variable-form taper equation that describes the taper of the tree.
bi_vol

Estimate the total or partial volume of the tree, based on a fitted Bi (2000) taper function.
kozak_logs_plot

Visualize the simulation of log cutting along the stem using a Kozak (2004) variable-form taper equation.
kozak_logs

Simulate log extraction using a Kozak (2004) variable-form taper equation that describes the taper of the tree.
kozak_di

Estimate the diameter at a given height based on a fitted Kozak (2004) taper equation.
kozak_vol

Estimate the total or partial volume of the tree, based on a fitted Kozak (2004) taper function.
bi_logs_plot

Visualize the simulation of log cutting along the stem using a Bi (2000) variable-form taper equation.
bi_hi

Estimate the height at which a given diameter occurs in a tree, based on a fitted Bi (2000) taper equation.
poly5_logs_plot

Visualize the simulation of log cutting along the stem using a 5th degree polynomial that describes the tree taper.
tree_scaling

Tree scaling example data
taper_kozak

Kozak (2004) Taper Function.
%>%

Pipe operator
poly5_di

Estimate the diameter at a given height based on a 5th degree polynomial function.
poly5_logs

Simulate log extraction using a 5th degree polynomial that describes the taper of the tree.
poly5_hi

Estimate the height at which a given diameter occurs in a tree, based on a 5th degree polynomial function.
poly5_vol

Estimate the total or partial volume of the tree, based on a 5th degree polynomial function that describes the taper of the tree.
taper_bi

Bi (2004) Taper Function.
select_and_remove

Remove unwanted data by selecting it