| Type: | Package |
| Title: | Taper, Volume and Bark Thickness Models for Spruce, Pine and Birch in Norway |
| Version: | 0.2.1 |
| Description: | Stem taper, bark thickness, and volume models for the main Norwegian tree species (Norway spruce, Scots pine, and birch), based on Hansen et al. (2023) <doi:10.1080/02827581.2023.2243821> and the correction <doi:10.1080/02827581.2024.2358467>. Provides functions to predict stem diameter along the bole, bark thickness, and stem volume by numerical integration of the taper curve, and to invert these relationships (e.g. estimating height and diameter at breast height from measured diameters). |
| License: | MIT + file LICENSE |
| URL: | https://github.com/SmartForest-no/taperNOR |
| BugReports: | https://github.com/SmartForest-no/taperNOR/issues |
| Encoding: | UTF-8 |
| Language: | en-US |
| Imports: | TapeR |
| Depends: | R (≥ 2.10) |
| Suggests: | spelling, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-06-19 12:41:24 UTC; JoRa |
| Author: | Johannes Rahlf [aut, cre], Endre Hofstad Hansen [aut] |
| Maintainer: | Johannes Rahlf <johannes.rahlf@nibio.no> |
| Repository: | CRAN |
| Date/Publication: | 2026-06-25 16:00:02 UTC |
Bark model for spruce, pine, and birch for Norway
Description
The bark models are based on Hannrup B. 2004. Funktioner för skattning av barkens tjocklek hos tall och gran vid avverkning med skördare. (Functions for prediction of bark thickness of Norway spruce and Scots pine at CTL-harvesting). Arbetsrapport 575. Skogforsk, Uppsala. via Stängle et al. 2017. Comparison of models for estimating bark thickness of Picea abies in southwest Germany: the role of tree, stand, and environmental factors. Ann For Sci. 74(1):16.
Usage
barkNOR(d, h, dbh, h_top, sp = "spruce")
Arguments
d |
diameter (cm). |
h |
height above ground (m). |
dbh |
diameter at breast height, 1.3 m above ground (cm). |
h_top |
tree height above ground (m). |
sp |
species ('spruce','pine' or 'birch'; 1:3) |
Value
double bark thickness (cm) at height h with diameter d.
Examples
barkNOR(d=30, h=1,dbh=25,h_top=30,sp="pine")
taper<-taperNOR(h=(0:300)/10,dbh=25,h_top=30,sp="pine")
bark<-barkNOR(d=taper, h=(0:300)/10,dbh=25,h_top=30,sp="pine")
plot((0:300)/10,taper,type="l",col="brown",xlab="height (m)",ylab="taper/bark (cm)")
points((0:300)/10,taper-bark/10,type="l",col="green")
legend("topright",legend = c("taper","bark"),fill=c("brown","green"),border=NA)
points((0:300)/10,bark,type="l",ylab="bark (cm)",xlab="height (m)")
Estimate height of diameters along the stem
Description
Estimates heights of given diameters along the stem using optimization of the taper function.
Usage
dlocation(dbh, h_top, d, sp = "spruce", with_bark = TRUE)
Arguments
dbh |
diameter at breast height (1.3 m above ground) over bark (cm). |
h_top |
height above ground of diameter measurements (m). |
d |
diameters (cm). |
sp |
species. |
with_bark |
diameter with (TRUE, default) or without bark (FALSE). |
Value
Height of given diameter (m).
Examples
dlocation(dbh=35,h_top=35,d=c(25,40,12,2,70),sp="birch")
dlocation(dbh=35,h_top=35,d=c(25,40,12,2,70),sp="birch",with_bark=FALSE)
D<-35
H<-34
Sp<-"G"
#Case 1:
dia<-21
h_vol<-dlocation(d=dia,dbh=D,h_top=H,sp=Sp)
volume(D,H,sp=Sp,h_vol_lower = h_vol)
#Case2:
dia<- c(21,16)
A<-1.2
h_vol<- dlocation(d=dia,dbh=D,h_top=H,sp=Sp)
if (diff(h_vol)>A) volume(D,H,sp=Sp,h_vol_lower = h_vol[1],h_vol_upper=h_vol[2])
Estimate tree height above ground from diameters
Description
Estimates tree height above ground from diameters using optimization of the taper function.
Usage
hfromd(d, h, sp = "spruce", output = "h", grd_search = FALSE)
Arguments
d |
diameters (cm). |
h |
height above ground of diameter measurements (m). |
sp |
species |
output |
output from optimization: 'h' outputs the tree height,'d' diameter at breast height, 'all' result of optim. |
grd_search |
if TRUE optimization is run on a matrix of initial parameters. The result of the best fit is returned. Might give better result at cost of performance. |
Value
Tree height above ground (m).
Examples
hfromd(d=c(39,27),h=c(2,7),sp="birch")
Taper model for spruce, pine, and birch for Norway with dynamic diameter input
Description
Based on Kublin et al. 2013. A flexible stem taper and volume prediction method based on mixed-effects B-spline regression. Eur J For Res. 132(5-6):983–997 and code in Kublin & Breidenbach (https://CRAN.R-project.org/package=TapeR).
Usage
kublin_nor(Hx = NULL, Hm, Dm, mHt, sp = 1, Dx = NULL, ...)
Arguments
Hx |
height above ground where to return diameters (m) |
Hm |
height above ground of measured diameters (m) |
Dm |
measured diameters (cm) |
mHt |
measured tree height (m) above ground |
sp |
species. Spruce and pine are currently supported
(spruce: "spruce", "s", "gran", "g", "1"; pine: "pine", "p", "furu", "f",
"2"). The Kublin (TapeR) mixed-effects model has not yet been fitted for
birch in this package, so birch raises an error - use |
Dx |
or diameters (cm) for which to return a height |
... |
parameters handed over to E_DHx_HmDm_HT.f or E_HDx_HmDm_HT.f |
Details
Allows the use of multiple diameters measured at various points along the stem to estimate taper.
Value
When Hx is given: diameters at Hx (cm). When Dx is given: heights where d=Dx (m).
TapeR::E_HDx_HmDm_HT.f() only root-finds a single height per call, so when
Dx has length > 1 it is called once per element of Dx and the
resulting heights are combined into a vector of the same length as Dx.
Examples
# Spruce stem with diameters of 30 cm at 1.3 m and 22 cm at 5 m above
# ground, and a total height of 25 m. (Spruce and pine are supported.)
# Height(s) (m) at which the stem reaches 25 and 15 cm in diameter:
kublin_nor(Dx = c(25, 15), Hm = c(1.3, 5), Dm = c(30, 22), mHt = 25, sp = "spruce")
# Diameters (cm) predicted at 1.3, 5 and 10 m above ground (pine):
kublin_nor(Hx = c(1.3, 5, 10), Hm = c(1.3, 5), Dm = c(30, 22), mHt = 25, sp = "pine")$DHx
Plot taper curve
Description
Plots the taper curve
Usage
plot_taper(dbh, h_top, sp = "spruce", with_bark = TRUE)
Arguments
dbh |
diameter at breast height, 1.3 m above ground (cm). |
h_top |
tree height above ground (m). |
sp |
species |
with_bark |
plot taper curve with (TRUE, default) or without bark (FALSE). |
Value
No return value. Called for its side effect of drawing a taper-curve plot on the current graphics device.
Examples
#one tree
plot_taper(33,30)
# multiple trees
plot_taper(dbh=c(33,20,18),h_top=c(30,25,20),sp=c(1,1,3))
# different tree species with same dbh and height
plot_taper(dbh=rep(25,3),h_top=rep(27,3),sp=1:3)
#one tree with and without bark
plot_taper(dbh=rep(25,2),h_top=rep(27,2),sp=1,with_bark=c(TRUE,FALSE))
Taper model for spruce, pine, and birch in Norway
Description
Computes stem diameters (taper) along the bole of spruce, pine, and birch in Norway. The function implements the taper equations described in Hansen et al. (2023), based on Kozak’s (1988) variable-exponent taper equation. The original article by Hansen et al. (2023) contains minor errata (e.g., missing brackets, the use of 'Log' instead of 'ln', and a sign error at 'b7' in the pine taper model), but these do not affect the present implementation.
Usage
taperNOR(h, dbh, h_top, sp = "spruce", with_bark = TRUE)
Arguments
h |
A numeric vector of heights above ground (in meters) at which to return diameters. |
dbh |
Diameter at breast height (1.3 m above ground), over bark (in centimeters). |
h_top |
Total tree height (in meters). |
sp |
Character or numeric value indicating the species; recognized inputs include:
Defaults to |
with_bark |
Logical. If |
Value
A numeric vector of diameters (in centimeters) at each height in h.
References
Hansen, E., Rahlf, J., Astrup, R., & Gobakken, T. (2023). Taper, volume, and bark thickness models for spruce, pine, and birch in Norway. Scandinavian Journal of Forest Research, doi:10.1080/02827581.2023.2243821.
Kozak, A. (1988). A variable-exponent taper equation. Canadian Journal of Forest Research, 18(11), 1363–1368.
See Also
barkNOR for details on bark thickness subtraction.
Examples
# Example usage:
# Calculate taper for pine, at heights 1:30 m, dbh = 20 cm, total height = 30 m:
taperNOR(h = 1:30, dbh = 20, h_top = 30, sp = "pine", with_bark = TRUE)
# To get diameters under bark:
taperNOR(h = 1:30, dbh = 20, h_top = 30, sp = "pine", with_bark = FALSE)
Calculate volume
Description
Calculates volume from taper model by integrating the taper function.
Usage
volume(
dbh,
h_top,
h_vol_lower = NA,
h_vol_upper = NA,
sp = "spruce",
with_bark = TRUE
)
Arguments
dbh |
numeric vector of diameters at breast height, 1.3 m above ground (cm). |
h_top |
numeric vector of tree heights above ground (m). |
h_vol_lower |
numeric vector of lower height for stem volume calculation (m). NA in h_vol_lower is replaced by stump height (1% of h_top). |
h_vol_upper |
numeric vector of upper height for stem volume calculation (m). NA in h_vol_upper is replaced by h_top. |
sp |
species. |
with_bark |
calculate volume over (TRUE, default) or under bark (FALSE). |
Value
Timber volume (m^3).
Examples
volume(20, 30)
volume(dbh=c(20,25,30), h_top=c(30,25,37))
volume(dbh=rep(25,11), h_top=rep(30,11),h_vol_lower=seq(0,30,3))
volume(dbh=rep(25,11), h_top=rep(30,11),h_vol_upper=seq(0,30,3))
volume(dbh=rep(25,11), h_top=rep(30,11),h_vol_lower=0,h_vol_upper=seq(0,30,3),with_bark=FALSE)