# example data
data(DxHx.df)
# taper curve parameters based on all measured trees
data(SK.par.lme)
#select data of first tree
Idi <- (DxHx.df[,"Id"] == unique(DxHx.df$Id)[1])
(tree1 <- DxHx.df[Idi,])
## Predict the taper curve based on the diameter measurement in 2 m
## height and known height
tc.tree1 <- E_DHx_HmDm_HT.f(Hx=1:tree1$Ht[1],
Hm=tree1$Hx[3],
Dm=tree1$Dx[3],
mHt = tree1$Ht[1],
sHt = 0,
par.lme = SK.par.lme)
#plot the predicted taper curve
plot(tc.tree1$Hx, tc.tree1$DHx, type="l", las=1)
## Calculate the height given a certain diameter threshold, say 8.5 cm
ht.tree1.d8.5 <- E_HDx_HmDm_HT.f (Dx=8.5,
Hm=tree1$Hx[3],
Dm=tree1$Dx[3],
mHt = tree1$Ht[1],
sHt = 1,
par.lme = SK.par.lme,
Rfn=list(fn="sig2"))
# add to plot
points(x=ht.tree1.d8.5, y=8.5, pch=8, col=2, cex=2)
Run the code above in your browser using DataLab