Rick Lingle
March 18, 2016
Coursera Data Products Project
Loblolly Pine trees are one of the most commerically important trees in the southern United States, so Loblolly Pine tree farms are very common in this area. Tree growth is usually calculated with respect to log of time, but most people think linearly. This algorithm allows to select number of years for tree growth and shows the predicted tree height on linear plot and log-scale plot. The minimum time is 1 year with maximum time is 100 years, interval is 0.5 years.
R has a built in dataset for Loblolly tree growth with measurements through 25years:
data(Loblolly)
summary(Loblolly)
height age Seed
Min. : 3.46 Min. : 3.0 329 : 6
1st Qu.:10.47 1st Qu.: 5.0 327 : 6
Median :34.00 Median :12.5 325 : 6
Mean :32.36 Mean :13.0 307 : 6
3rd Qu.:51.36 3rd Qu.:20.0 331 : 6
Max. :64.10 Max. :25.0 311 : 6
(Other):48
library(ggplot2)
t1 <- Loblolly
m1 <- lm(height ~ I(log(age)), data=t1)
t1$predict <- predict(m1, t1)
qq <- qplot(age, height, colour=Seed, data=t1) +
geom_line(data=t1, aes(x=age, y=predict), colour="red", lwd=1) +
labs(x="Age (years)") + labs(y="Height (ft)") +
labs(title="Loblolly Tree Height")