##Purpose
The purpose of this page is to document the analyses of the redcedar adaptation network data.
Merged data set was downloaded from adaptation-data-merged.csv. Analyses were completed to explore the relationship between origin seed zone and two continuous and one binary variable representing tree health.
Two identical analyses were completed to determine whether wildlife tree browsing activity posed as a confounded variable in our experimental design as levels of browsing varied from none to heavily browsed across each planting site. The first set of analyses completely excluded browsed trees from the data set if the trees were ever browsed across all measurement years. The second set of analyses included every tree regardless of browsing level.
library(tidyverse)
library(kableExtra)
library(patchwork)
library(zoo)
library(readxl)
library(knitr)
library(lme4)
library(lmerTest)
trees <- read.csv("https://raw.githubusercontent.com/zarigal/adaptation/refs/heads/main/data/adaptation-data-merged.csv")
#if offline - data <-read.csv("data/adaptation-data-merged.csv")
The following plots, tables, and analysis completely excludes all years’ measurements from trees that had any instance of wildlife browsing observed during re-measurements.
trees.no.browse <- trees %>%
group_by(Tree.Number, Site, Seed.Zone) %>%
filter(Elk.Browse !="Y") %>% ungroup()
treesno.wide <- trees.no.browse %>% pivot_wider(
id_cols = c(Tree.Number, Site, Seed.Zone, New.Tree.Number),
names_from = Measurement.Year,
values_from = c(Tree.Height..cm., Tree.Diameter..mm.),
names_glue = "{.value}_{Measurement.Year}")
treesno.wide.growth <- treesno.wide %>% mutate(y1.height.growth = Tree.Height..cm._2023-Tree.Height..cm._2022, y2.height.growth = Tree.Height..cm._2024-Tree.Height..cm._2023, y3.height.growth = Tree.Height..cm._2025-Tree.Height..cm._2024, y1.diameter.growth = Tree.Diameter..mm._2023-Tree.Diameter..mm._2022, y2.diameter.growth = Tree.Diameter..mm._2024-Tree.Diameter..mm._2023, y3.diameter.growth = Tree.Diameter..mm._2025 - Tree.Diameter..mm._2024, total.height.growth = Tree.Height..cm._2025-Tree.Height..cm._2022, total.diameter.growth = Tree.Diameter..mm._2025-Tree.Diameter..mm._2022)
treesno.wide.pos.total <- treesno.wide.growth %>% filter(total.height.growth>0 & total.diameter.growth>0)
treesno.wide.pos.y1 <- treesno.wide.growth %>% filter(y1.height.growth>0 & y1.diameter.growth>0)
treesno.wide.pos.y2 <- treesno.wide.growth %>% filter(y2.height.growth>0 & y2.diameter.growth>0)
treesno.wide.pos.y3 <- treesno.wide.growth %>% filter(y3.height.growth>0 & y3.diameter.growth>0)
treesno.wide.pos.all <- treesno.wide.growth %>% filter(y1.height.growth>0 & y1.diameter.growth>0 &
y2.height.growth>0 & y2.diameter.growth>0 & y3.height.growth>0 & y3.diameter.growth>0)
The below table lists the number of trees that were remeasured in 2025 at each site, excluding outliers.
Site.Summary <- treesno.wide.pos.all %>% group_by(Site,Seed.Zone) %>% summarize(n=n())
kable(Site.Summary[c(1,2,3)], col.names = c("Site", "Seed Zone", "Number of Trees")) %>% kable_material(c("striped", "hover","condensed"))
| Site | Seed Zone | Number of Trees |
|---|---|---|
| Renton | OR | 14 |
| Renton | WA | 31 |
| Seattle | OR | 27 |
| Seattle | WA | 33 |
| Swan Creek | OR | 26 |
| Swan Creek | WA | 19 |
| Tomanamus | OR | 7 |
| Tomanamus | WA | 3 |
The below table lists mean height and diameter increases between seed zones.
treesno.summary <- treesno.wide.pos.all %>% group_by(Seed.Zone) %>% summarize(n=n(),
meanno.height.2025=mean(Tree.Height..cm._2025),
meanno.diameter.2025=mean(Tree.Diameter..mm._2025),
meanno.y1.height.growth=mean(y1.height.growth,na.rm=TRUE),
meanno.y1.diameter.growth=mean(y1.diameter.growth,na.rm=TRUE),
meanno.y2.height.growth=mean(y2.height.growth,na.rm=TRUE),
meanno.y2.diameter.growth=mean(y2.diameter.growth,na.rm=TRUE),
meanno.y3.diameter.growth=mean(y3.diameter.growth,na.rm=TRUE),
meanno.y3.height.growth=mean(y3.height.growth,na.rm=TRUE),
meanno.total.height.growth=mean(total.height.growth,na.rm=TRUE),
meanno.total.diameter.growth=mean(total.diameter.growth,na.rm=TRUE))
kable(treesno.summary,col.names = c("Seed Zone", "Number of Trees", "2025 Mean Height (cm)", "2025 Mean Diameter (mm)", "Mean Year 1 Height Growth (cm)", "Mean Year 1 Diameter Growth (mm)", "Mean Year 2 Height Growth (cm)","Mean Year 2 Diameter Growth (mm)", "Mean Year 3 Height Growth (cm)","Mean Year 3 Diameter Growth (mm)", "Total Mean Height Growth (cm)","Total Mean Diameter Growth (mm)"), digits = 2,format = "html",table.attr='class="scrollable-table"') %>% kable_material(c("striped", "hover","condensed")) %>% kable_styling(full_width = F) %>% scroll_box(height = "200px")
| Seed Zone | Number of Trees | 2025 Mean Height (cm) | 2025 Mean Diameter (mm) | Mean Year 1 Height Growth (cm) | Mean Year 1 Diameter Growth (mm) | Mean Year 2 Height Growth (cm) | Mean Year 2 Diameter Growth (mm) | Mean Year 3 Height Growth (cm) | Mean Year 3 Diameter Growth (mm) | Total Mean Height Growth (cm) | Total Mean Diameter Growth (mm) |
|---|---|---|---|---|---|---|---|---|---|---|---|
| OR | 74 | 158.84 | 34.39 | 8.36 | 3.85 | 32.46 | 11.04 | 10.50 | 34.36 | 75.19 | 25.39 |
| WA | 86 | 171.20 | 35.49 | 7.38 | 3.79 | 33.39 | 10.05 | 11.39 | 37.80 | 78.57 | 25.23 |
Trees from Oregon had a mean total height increase of 75.19cm and trees from Washington had a mean total height increase of 78.57cm.
The table below provides the same data, expect the means were calculated across seed zones and sites.
treesno.summary.sites <- treesno.wide.pos.all %>% group_by(Site,Seed.Zone) %>% summarize(
n=n(),
meanno.height.2025=mean(Tree.Height..cm._2025),
meanno.diameter.2025=mean(Tree.Diameter..mm._2025),
meanno.y1.height.growth=mean(y1.height.growth,na.rm=TRUE),
meanno.y1.diameter.growth=mean(y1.diameter.growth,na.rm=TRUE),
meanno.y2.height.growth=mean(y2.height.growth,na.rm=TRUE),
meanno.y2.diameter.growth=mean(y2.diameter.growth,na.rm=TRUE),
meanno.y3.diameter.growth=mean(y3.diameter.growth,na.rm=TRUE),
meanno.y3.height.growth=mean(y3.height.growth, na.rm = TRUE),
meanno.total.height.growth=mean(total.height.growth,na.rm=TRUE),
meanno.total.diameter.growth=mean(total.diameter.growth,na.rm=TRUE))
library(knitr)
kable(treesno.summary.sites, col.names = c("Site", "Seed Zone", "Number of Trees", "2025 Mean Height (cm)", "2025 Mean Diameter (mm)", "Mean Year 1 Height Growth (cm)", "Mean Year 1 Diameter Growth (mm)", "Mean Year 2 Height Growth (cm)","Mean Year 2 Diameter Growth (mm)", "Mean Year 3 Height Growth (cm)","Mean Year 3 Diameter Growth (mm)", "Total Mean Height Growth (cm)","Total Mean Diameter Growth (mm)"), digits = 2) %>% kable_material(c("striped", "hover","condensed")) %>% kable_styling(full_width = F) %>% scroll_box(height = "300px")
| Site | Seed Zone | Number of Trees | 2025 Mean Height (cm) | 2025 Mean Diameter (mm) | Mean Year 1 Height Growth (cm) | Mean Year 1 Diameter Growth (mm) | Mean Year 2 Height Growth (cm) | Mean Year 2 Diameter Growth (mm) | Mean Year 3 Height Growth (cm) | Mean Year 3 Diameter Growth (mm) | Total Mean Height Growth (cm) | Total Mean Diameter Growth (mm) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Renton | OR | 14 | 146.29 | 20.76 | 7.93 | 2.81 | 26.21 | 3.12 | 4.94 | 26.86 | 61.00 | 10.87 |
| Renton | WA | 31 | 169.23 | 24.80 | 7.95 | 2.78 | 31.55 | 4.60 | 6.52 | 33.71 | 73.21 | 13.91 |
| Seattle | OR | 27 | 176.63 | 42.07 | 11.04 | 5.21 | 44.52 | 15.54 | 13.32 | 38.89 | 94.45 | 34.08 |
| Seattle | WA | 33 | 180.18 | 44.90 | 8.76 | 5.26 | 41.58 | 14.56 | 15.88 | 40.82 | 91.15 | 35.71 |
| Swan Creek | OR | 26 | 151.12 | 37.08 | 6.54 | 3.65 | 25.42 | 12.44 | 11.54 | 35.04 | 67.00 | 27.63 |
| Swan Creek | WA | 19 | 161.21 | 39.43 | 4.46 | 3.33 | 23.53 | 12.25 | 12.86 | 40.21 | 68.20 | 28.44 |
| Tomanamus | OR | 7 | 144.00 | 21.99 | 5.66 | 1.44 | 24.57 | 4.27 | 6.85 | 29.43 | 59.66 | 12.56 |
| Tomanamus | WA | 3 | 156.00 | 17.55 | 4.70 | 0.90 | 24.83 | 2.77 | 2.91 | 31.67 | 61.20 | 6.58 |
The below plots show the distributions in increases in tree height for each seed zone.
P1 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,y1.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)", x= "Seed Source",title="Year 1 Growth") + theme(plot.title = element_text(hjust = 0.5))
P2 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,y2.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)",x= "Seed Source",title="Year 2 Growth") + theme(plot.title = element_text(hjust = 0.5))
P3 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,y3.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)",x= "Seed Source",title="Year 3 Growth") + theme(plot.title = element_text(hjust = 0.5))
P4 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,total.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)",x= "Seed Source",title="Cumulative Growth") + theme(plot.title = element_text(hjust = 0.5))
height_plots <- P1 + P2 + P3 + P4
height_plots + plot_annotation(title = "Growth in Height (cm) by Year", theme = theme(plot.title = element_text(hjust = 0.5)))
The below plot shows the distributions in cumulative increase in tree height for each seed zone and site.
ggplot(treesno.wide.pos.all,aes(Seed.Zone,total.height.growth,fill=Site)) +geom_boxplot(alpha=0.7) +theme_bw() +scale_fill_manual(values=c("#fe9929", "#7fcdbb", "#DDA0DD","#89CFF0")) + labs(y= "Total Height Growth (cm)",x= "Seed Source",title="Cumulative Height Growth by Site") + theme(plot.title = element_text(hjust = 0.5))
The below plots show the distribution of growth in tree diameter for each seed zone.
P1 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,y1.diameter.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Diameter Growth (mm)", x= "Seed Source",title="Year 1 Growth") + theme(plot.title = element_text(hjust = 0.5))
P2 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,y2.diameter.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Diameter Growth (mm)",x= "Seed Source",title="Year 2 Growth") + theme(plot.title = element_text(hjust = 0.5))
P3 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,y3.diameter.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Diameter Growth (mm)",x= "Seed Source",title="Year 3 Growth") + theme(plot.title = element_text(hjust = 0.5))
P4 <- ggplot(treesno.wide.pos.all,aes(Seed.Zone,total.diameter.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Diameter Growth (mm)",x= "Seed Source",title="Cumulative Growth") + theme(plot.title = element_text(hjust = 0.5))
height_plots <- P1 + P2 + P3 + P4
height_plots + plot_annotation(title = "Growth in Diameter (mm) by Year", theme = theme(plot.title = element_text(hjust = 0.5)))
The below plots show the distributions in increases in tree diameter for each seed zone and site.
ggplot(treesno.wide.pos.all,aes(Seed.Zone,total.diameter.growth,fill=Site)) +geom_boxplot(alpha=0.7) +theme_bw() +scale_fill_manual(values=c("#fe9929", "#7fcdbb", "#DDA0DD","#89CFF0")) + labs(y= "Total Diameter Growth (mm)",x= "Seed Source",title="Cumulative Diameter Growth by Site") + theme(plot.title = element_text(hjust = 0.5))
The below plot shows the number of trees that fall under each Health condition: alive, dead, or missing.
treesno.condition.zone <- trees.no.browse %>% group_by(Seed.Zone,Final.Health) %>% summarize(n=n_distinct(Temp.Tree.Number)) %>% filter(Final.Health!="NA")
ggplot(treesno.condition.zone,aes(x = reorder(Seed.Zone, -n),n,fill=Final.Health))+geom_col(alpha=0.7,position = position_dodge2(preserve = "single",reverse=TRUE))+theme_bw()+coord_flip()+ scale_y_continuous(breaks = c(0,25,50,75,100,125,150),expand = expansion(mult = c(0.05, 0.1))) +scale_fill_manual(values=c( "#DDA0DD","#7fcdbb","#fe9929","#CC79A7"))+labs(x="Site",y="Number of Trees",title ="Health Condition by Seed Zone", fill="Health Condition") +geom_text(aes(label=n,group=Final.Health),position = position_dodge2(width=0.9,preserve = "single",reverse=TRUE),hjust=-0.1) + theme(plot.title = element_text(hjust = 0.5))
The below plot shows the number of trees that fall under each health condition sorted by seed zone and planting site. Not excluding browsed trees.
trees.condition <- trees %>% group_by(Site, Seed.Zone,Final.Health) %>% summarize(n=n_distinct(Temp.Tree.Number)) %>% filter(Final.Health!="NA")
trees.condition$Final.Health <- factor(trees.condition$Final.Health, levels=c('Alive','Dead','Dying','Missing'))
ggplot(trees.condition,aes(x = reorder(Site, -n),n,fill=Final.Health))+facet_wrap(~Seed.Zone)+geom_col(alpha=0.7,position = position_dodge2(preserve = "single",reverse=TRUE))+theme_bw()+coord_flip() + scale_y_continuous(expand = expansion(mult = c(0.05, 0.1))) +scale_fill_manual(values=c( "#DDA0DD","#7fcdbb","#fe9929","#CC79A7"))+labs(x="Site",y="Number of Trees", title = "Health Condition by Seed Zone and Site",fill="Health Condition") +geom_text(aes(label=n,group=Final.Health),position = position_dodge2(width=0.9,preserve = "single",reverse=TRUE),hjust=-0.1) + theme(plot.title = element_text(hjust = 0.5))
The following plots, tables, and analysis includes all years’ measurements trees browsed by wildlife.
trees$Site <- as.factor(trees$Site)
trees$Seed.Zone <-as.factor(trees$Seed.Zone)
trees$Health <- as.factor(trees$Health)
trees.wide <- trees %>% pivot_wider(
id_cols = c(Tree.Number, Site, Seed.Zone, New.Tree.Number),
names_from = Measurement.Year,
values_from = c(Tree.Height..cm., Tree.Diameter..mm.),
names_glue = "{.value}_{Measurement.Year}")
trees.wide.growth <- trees.wide %>% mutate(y1.height.growth = Tree.Height..cm._2023-Tree.Height..cm._2022, y2.height.growth = Tree.Height..cm._2024-Tree.Height..cm._2023, y3.height.growth = Tree.Height..cm._2025-Tree.Height..cm._2024, y1.diameter.growth = Tree.Diameter..mm._2023-Tree.Diameter..mm._2022, y2.diameter.growth = Tree.Diameter..mm._2024-Tree.Diameter..mm._2023, y3.diameter.growth = Tree.Diameter..mm._2025 - Tree.Diameter..mm._2024, total.height.growth = Tree.Height..cm._2025-Tree.Height..cm._2022, total.diameter.growth = Tree.Diameter..mm._2025-Tree.Diameter..mm._2022)
#trees.wide.pos.total <- trees.wide.growth %>% filter(total.height.growth>0 & total.diameter.growth>0)
#trees.wide.pos.y1 <- trees.wide.growth %>% filter(y1.height.growth>0 & y1.diameter.growth>0)
#trees.wide.pos.y2 <- trees.wide.growth %>% filter(y2.height.growth>0 & y2.diameter.growth>0)
#trees.wide.pos.y3 <- trees.wide.growth %>% filter(y3.height.growth>0 & y3.diameter.growth>0)
trees.wide.pos.all <- trees.wide.growth %>% filter(y1.height.growth>0 & y1.diameter.growth>0 &
y2.height.growth>0 & y2.diameter.growth>0 & y3.height.growth>0 & y3.diameter.growth>0)
## above code removes observations with negative growth year to year (from browsing)
The below table lists the number of trees that were remeasured in 2025 at each site, excluding outliers.
Site.Summary <- trees.wide.pos.all %>% group_by(Site,Seed.Zone) %>% summarize(n=n())
kable(Site.Summary[c(1,2,3)], col.names = c("Site", "Seed Zone", "Number of Trees")) %>% kable_material(c("striped", "hover","condensed"))
| Site | Seed Zone | Number of Trees |
|---|---|---|
| Renton | OR | 14 |
| Renton | WA | 32 |
| Seattle | OR | 27 |
| Seattle | WA | 33 |
| Swan Creek | OR | 26 |
| Swan Creek | WA | 19 |
| Tomanamus | OR | 19 |
| Tomanamus | WA | 10 |
The below table lists mean height and diameter increases between seed zones.
trees.summary <- trees.wide.pos.all %>% group_by(Seed.Zone) %>% summarize(
n=n(),
mean.height.2025=mean(Tree.Height..cm._2025),
mean.diameter.2025=mean(Tree.Diameter..mm._2025),
mean.y1.height.growth=mean(y1.height.growth,na.rm=TRUE),
mean.y1.diameter.growth=mean(y1.diameter.growth,na.rm=TRUE),
mean.y2.height.growth=mean(y2.height.growth,na.rm=TRUE),
mean.y2.diameter.growth=mean(y2.diameter.growth,na.rm=TRUE),
mean.y3.height.growth=mean(y3.height.growth,na.rm=TRUE),
mean.y3.diameter.growth=mean(y3.diameter.growth,na.rm=TRUE),
mean.total.height.growth=mean(total.height.growth,na.rm=TRUE),
mean.total.diameter.growth=mean(total.diameter.growth,na.rm=TRUE))
kable(trees.summary,col.names = c("Seed Zone", "Number of Trees", "2025 Mean Height (cm)", "2025 Mean Diameter (mm)", "Mean Year 1 Height Growth (cm)", "Mean Year 1 Diameter Growth (mm)", "Mean Year 2 Height Growth (cm)","Mean Year 2 Diameter Growth (mm)", "Mean Year 3 Height Growth (cm)","Mean Year 3 Diameter Growth (mm)", "Total Mean Height Growth (cm)","Total Mean Diameter Growth (mm)"), digits = 2,format = "html", table.attr='class="scrollable-table"') %>% kable_material(c("striped", "hover","condensed")) %>% kable_styling(full_width = F) %>% scroll_box(height = "300px")
| Seed Zone | Number of Trees | 2025 Mean Height (cm) | 2025 Mean Diameter (mm) | Mean Year 1 Height Growth (cm) | Mean Year 1 Diameter Growth (mm) | Mean Year 2 Height Growth (cm) | Mean Year 2 Diameter Growth (mm) | Mean Year 3 Height Growth (cm) | Mean Year 3 Diameter Growth (mm) | Total Mean Height Growth (cm) | Total Mean Diameter Growth (mm) |
|---|---|---|---|---|---|---|---|---|---|---|---|
| OR | 86 | 156.80 | 32.38 | 8.41 | 3.70 | 31.55 | 9.97 | 34.01 | 9.89 | 73.97 | 23.56 |
| WA | 94 | 169.44 | 34.34 | 7.22 | 3.62 | 32.69 | 9.47 | 36.83 | 10.93 | 76.73 | 24.02 |
Trees from Oregon had a mean total height increase of 73.97cm and trees from Washington had a mean total height increase of 76.73cm.
The table below provides the same data, expect the means were calculated across seed zones and sites.
trees.summary.sites <- trees.wide.pos.all %>% group_by(Site,Seed.Zone) %>% summarize(
n=n(),
mean.height.2025=mean(Tree.Height..cm._2025),
mean.diameter.2025=mean(Tree.Diameter..mm._2025),
mean.y1.height.growth=mean(y1.height.growth,na.rm=TRUE),
mean.y1.diameter.growth=mean(y1.diameter.growth,na.rm=TRUE),
mean.y2.height.growth=mean(y2.height.growth,na.rm=TRUE),
mean.y2.diameter.growth=mean(y2.diameter.growth,na.rm=TRUE),
mean.y3.diameter.growth=mean(y3.diameter.growth,na.rm=TRUE),
mean.y3.height.growth=mean(y3.height.growth, na.rm = TRUE),
mean.total.height.growth=mean(total.height.growth,na.rm=TRUE),
mean.total.diameter.growth=mean(total.diameter.growth,na.rm=TRUE))
kable(trees.summary.sites, col.names = c("Site", "Seed Zone", "Number of Trees", "2025 Mean Height (cm)", "2025 Mean Diameter (mm)", "Mean Year 1 Height Growth (cm)", "Mean Year 1 Diameter Growth (mm)", "Mean Year 2 Height Growth (cm)","Mean Year 2 Diameter Growth (mm)", "Mean Year 3 Height Growth (cm)","Mean Year 3 Diameter Growth (mm)", "Total Mean Height Growth (cm)","Total Mean Diameter Growth (mm)"), digits = 2) %>% kable_material(c("striped", "hover","condensed")) %>% kable_styling(full_width = F) %>% scroll_box(height = "400px")
| Site | Seed Zone | Number of Trees | 2025 Mean Height (cm) | 2025 Mean Diameter (mm) | Mean Year 1 Height Growth (cm) | Mean Year 1 Diameter Growth (mm) | Mean Year 2 Height Growth (cm) | Mean Year 2 Diameter Growth (mm) | Mean Year 3 Height Growth (cm) | Mean Year 3 Diameter Growth (mm) | Total Mean Height Growth (cm) | Total Mean Diameter Growth (mm) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Renton | OR | 14 | 146.29 | 20.76 | 7.93 | 2.81 | 26.21 | 3.12 | 4.94 | 26.86 | 61.00 | 10.87 |
| Renton | WA | 32 | 168.19 | 24.49 | 7.80 | 2.73 | 31.31 | 4.48 | 6.40 | 33.50 | 72.61 | 13.61 |
| Seattle | OR | 27 | 176.63 | 42.07 | 11.04 | 5.21 | 44.52 | 15.54 | 13.32 | 38.89 | 94.45 | 34.08 |
| Seattle | WA | 33 | 180.18 | 44.90 | 8.76 | 5.26 | 41.58 | 14.56 | 15.88 | 40.82 | 91.15 | 35.71 |
| Swan Creek | OR | 26 | 151.12 | 37.08 | 6.54 | 3.65 | 25.42 | 12.44 | 11.54 | 35.04 | 67.00 | 27.63 |
| Swan Creek | WA | 19 | 161.21 | 39.43 | 4.46 | 3.33 | 23.53 | 12.25 | 12.86 | 40.21 | 68.20 | 28.44 |
| Tomanamus | OR | 19 | 144.16 | 20.74 | 7.58 | 2.28 | 25.42 | 3.73 | 6.39 | 30.95 | 63.95 | 12.40 |
| Tomanamus | WA | 10 | 153.60 | 21.34 | 5.51 | 1.64 | 25.15 | 3.37 | 5.41 | 27.90 | 58.56 | 10.42 |
The below plots show the distributions in increases in tree height for each seed zone.
P1 <- ggplot(trees.wide.pos.all,aes(Seed.Zone,y1.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)", x= "Seed Source",title="Year 1 Growth") + theme(plot.title = element_text(hjust = 0.5))
P2 <- ggplot(trees.wide.pos.all,aes(Seed.Zone,y2.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)",x= "Seed Source",title="Year 2 Growth") + theme(plot.title = element_text(hjust = 0.5))
P3 <- ggplot(trees.wide.pos.all,aes(Seed.Zone,y3.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)",x= "Seed Source",title="Year 3 Growth") + theme(plot.title = element_text(hjust = 0.5))
P4 <- ggplot(trees.wide.pos.all,aes(Seed.Zone,total.height.growth,fill=Seed.Zone)) +geom_violin(alpha=0.7) +geom_boxplot(alpha=0.7) +theme_bw()+guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(y= "Height Growth (cm)",x= "Seed Source",title="Cumulative Growth") + theme(plot.title = element_text(hjust = 0.5))
height_plots <- P1 + P2 / P3 + P4
height_plots + plot_annotation(title = "Growth in Height (cm) by Year", theme = theme(plot.title = element_text(hjust = 0.5)))
G1 <- ggplot(trees.wide.pos.all,aes(y1.diameter.growth,Seed.Zone,fill=Seed.Zone))+geom_boxplot(alpha=0.7) +theme_bw() +guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(x= "Height Growth (cm)",y= "Seed Source",title="Year 1 Growth") + theme(plot.title = element_text(hjust = 0.5))
G2 <- ggplot(trees.wide.pos.all,aes(y2.diameter.growth,Seed.Zone,fill=Seed.Zone))+geom_boxplot(alpha=0.7) +theme_bw() +guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(x= "Height Growth (cm)",y= "Seed Source",title="Year 2 Growth") + theme(plot.title = element_text(hjust = 0.5))
G3 <- ggplot(trees.wide.pos.all,aes(y3.diameter.growth,Seed.Zone,fill=Seed.Zone))+geom_boxplot(alpha=0.7) +theme_bw() +guides(fill="none") +scale_fill_manual(values=c("#fe9929", "#7fcdbb")) +labs(x= "Height Growth (cm)",y= "Seed Source",title="Year 3 Growth") + theme(plot.title = element_text(hjust = 0.5))
G1 / G2 / G3
The below plots show the distributions in increases in tree height for each seed zone and site.
ggplot(trees.wide.pos.all,aes(Seed.Zone,total.height.growth,fill=Site)) +geom_boxplot(alpha=0.7) +theme_bw() +scale_fill_manual(values=c("#fe9929", "#7fcdbb", "#DDA0DD","#89CFF0")) + labs(y= "Total Height Growth (cm)",x= "Seed Source",title="Cumulative Height Growth by Site") + theme(plot.title = element_text(hjust = 0.5))
The below plots show the number of trees that fall under each Health condition: alive, dead, or missing.
trees.condition.zone <- trees %>% group_by(Seed.Zone,Final.Health) %>% summarize(n=n_distinct(Temp.Tree.Number)) %>% filter(Final.Health!="NA")
ggplot(trees.condition.zone,aes(x = reorder(Seed.Zone, -n),n,fill=Final.Health))+geom_col(alpha=0.7,position = position_dodge2(preserve = "single",reverse=TRUE))+theme_bw()+coord_flip()+ scale_y_continuous(breaks = c(0,25,50,75,100,125,150),expand = expansion(mult = c(0.05, 0.1))) +scale_fill_manual(values=c( "#DDA0DD","#7fcdbb","#fe9929","#CC79A7"))+labs(x="Site",y="Number of Trees",title ="Health Condition by Seed Zone", fill="Health Condition") +geom_text(aes(label=n,group=Final.Health),position = position_dodge2(width=0.9,preserve = "single",reverse=TRUE),hjust=-0.1) + theme(plot.title = element_text(hjust = 0.5))
The below plot shows the number of trees that fall under each health condition sorted by seed zone and planting site.
trees.condition <- trees %>% group_by(Site, Seed.Zone,Final.Health) %>% summarize(n=n_distinct(Temp.Tree.Number)) %>% filter(Final.Health!="NA")
trees.condition$Final.Health <- factor(trees.condition$Final.Health, levels=c('Alive','Dead','Dying','Missing'))
ggplot(trees.condition,aes(x = reorder(Site, -n),n,fill=Final.Health))+facet_wrap(~Seed.Zone)+geom_col(alpha=0.7,position = position_dodge2(preserve = "single",reverse=TRUE))+theme_bw()+coord_flip() + scale_y_continuous(expand = expansion(mult = c(0.05, 0.1))) +scale_fill_manual(values=c( "#DDA0DD","#7fcdbb","#fe9929","#CC79A7"))+labs(x="Site",y="Number of Trees", title = "Health Condition by Seed Zone and Site",fill="Health Condition") +geom_text(aes(label=n,group=Final.Health),position = position_dodge2(width=0.9,preserve = "single",reverse=TRUE),hjust=-0.1) + theme(plot.title = element_text(hjust = 0.5))
ggplot(trees,aes(Tree.Height..cm.,fill=Seed.Zone))+geom_histogram(alpha=0.7) +theme_bw() +scale_fill_manual(values=c("#fe9929", "#7fcdbb"))
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 186 rows containing non-finite outside the scale range
## (`stat_bin()`).
ggplot(trees,aes(Tree.Diameter..mm.,fill=Seed.Zone))+geom_histogram(alpha=0.7) +theme_bw() +scale_fill_manual(values=c("#fe9929", "#7fcdbb"))
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 193 rows containing non-finite outside the scale range
## (`stat_bin()`).
growth <- trees %>%
group_by(Tree.Number, Site, Seed.Zone) %>%
arrange(Measurement.Year) %>%
mutate(
Height.Change = Tree.Height..cm. - lag(Tree.Height..cm.),
Diameter.Change = Tree.Diameter..mm. - lag(Tree.Diameter..mm.)
)
growth.positive <- growth %>% filter(Height.Change>0)
ggplot(growth.positive,aes(Measurement.Year,Height.Change,color=Seed.Zone)) + geom_point(size = 2, alpha = 0.7,position=position_jitter()) + geom_smooth(method = "lm", se = TRUE, linetype = "solid") +labs(title = "Annual Height Change By Seed Source", x = "Measurement Year", y = "Height Change",color = "Treatment") +theme_minimal(base_size = 14) +scale_color_manual(values=c("#fe9929", "#7fcdbb")) + theme(plot.title = element_text(hjust = 0.5))
## `geom_smooth()` using formula = 'y ~ x'
ggplot(growth,aes(Measurement.Year,Height.Change,color=Seed.Zone)) + geom_smooth(method = "lm", se = TRUE, linetype = "solid") +labs(title = "Annual Height Change By Seed Source", x = "Measurement Year", y = "Height Change",color = "Treatment") +theme_minimal(base_size = 14) +scale_color_manual(values=c("#fe9929", "#7fcdbb")) + theme(plot.title = element_text(hjust = 0.5))
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 661 rows containing non-finite outside the scale range
## (`stat_smooth()`).
names(growth)
## [1] "X" "Tree.Number" "Site"
## [4] "Seed.Zone" "Measurement.Year" "Date.Measured"
## [7] "Tree.Height..cm." "Tree.Diameter..mm." "Health"
## [10] "Comment" "Date.Planted" "Temp.Tree.Number"
## [13] "New.Tree.Number" "Elk.Browse" "Planted.Growth.Days"
## [16] "Final.Health" "Height.Change" "Diameter.Change"
model <- lmer(Height.Change ~ Seed.Zone + (1 | Site) + (1|Elk.Browse), data = growth)
summary(model)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Height.Change ~ Seed.Zone + (1 | Site) + (1 | Elk.Browse)
## Data: growth
##
## REML criterion at convergence: 10370.7
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.9666 -0.6367 -0.1555 0.5705 7.1081
##
## Random effects:
## Groups Name Variance Std.Dev.
## Site (Intercept) 36.31 6.026
## Elk.Browse (Intercept) 161.58 12.711
## Residual 468.30 21.640
## Number of obs: 1153, groups: Site, 4; Elk.Browse, 2
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 10.878 9.543 1.241 1.140 0.428
## Seed.ZoneWA 1.473 1.278 1147.191 1.152 0.249
##
## Correlation of Fixed Effects:
## (Intr)
## Seed.ZoneWA -0.070