22.21 火炬松树的生长情况

22.3 记录了 14 颗火炬树种子的生长情况

reshape(Loblolly, idvar = "Seed", timevar = "age",
        v.names = "height", direction = "wide", sep = "") %>%
  knitr::kable(.,
    caption = "火炬松树的高度(英尺)随时间(年)的变化",
    row.names = FALSE, col.names = gsub("(height)", "", names(.)),
    align = "c"
  )
表 22.3: 火炬松树的高度(英尺)随时间(年)的变化
Seed 3 5 10 15 20 25
301 4.51 10.89 28.72 41.74 52.70 60.92
303 4.55 10.92 29.07 42.83 53.88 63.39
305 4.79 11.37 30.21 44.40 55.82 64.10
307 3.91 9.48 25.66 39.07 50.78 59.07
309 4.81 11.20 28.66 41.66 53.31 63.05
311 3.88 9.40 25.99 39.55 51.46 59.64
315 4.32 10.43 27.16 40.85 51.33 60.07
319 4.57 10.57 27.90 41.13 52.43 60.69
321 3.77 9.03 25.45 38.98 49.76 60.28
323 4.33 10.79 28.97 42.44 53.17 61.62
325 4.38 10.48 27.93 40.20 50.06 58.49
327 4.12 9.92 26.54 37.82 48.43 56.81
329 3.93 9.34 26.08 37.79 48.31 56.43
331 3.46 9.05 25.85 39.15 49.12 59.49

22.6 火炬树种子基本决定了树的长势,不同种子预示最后的高度,并且在生长期也是很稳定地生长

p <- ggplot(data = Loblolly, aes(x = age, y = height, color = Seed)) +
  geom_point() +
  geom_line() +
  theme_minimal() +
  labs(x = "age (yr)", y = "height (ft)")
p
不同火炬树的生长情况

图 22.6: 不同火炬树的生长情况

library(gganimate)
p + transition_reveal(age)