# Exercise 1 table
library(tidyverse)
prac2_ex1<-read.csv('data/prac2_student_ex1.csv')
#tidy up the data
prac2_ex1_tidy<-prac2_ex1%>%select(1, mean_size = 2, forest_int = 3, forest_edge = 4, mean_patch_size = 5)
#select lets you modify the number and position of columns, but also let's you rename them!
prac2_ex1_summary<-prac2_ex1_tidy%>%
group_by(mean_size)%>%
summarise(mean_forest_interior = mean(forest_int),
sd_forest_interior = sd(forest_int),
mean_forest_edge = mean(forest_edge),
sd_forest_edge = sd(forest_edge),
mean_patch = mean(mean_patch_size),
sd_patch = sd(mean_patch_size))
#To create a nice looking table in rmarkdown, use the `kable` function:
knitr::kable(prac2_ex1_summary,
caption = "Prac 2 Table 1", #don't forget the caption!
digits = 3,
col.names = c('Mean harvest size (ha)',
'Mean forest interior (ha)',
'Std. dev. Forest int. (ha)',
'Mean forest edge (ha)',
'Std. dev. forest edge (ha)',
'Mean patch size (ha)',
'Std. dev. patch size (ha)'))
| Mean harvest size (ha) | Mean forest interior (ha) | Std. dev. Forest int. (ha) | Mean forest edge (ha) | Std. dev. forest edge (ha) | Mean patch size (ha) | Std. dev. patch size (ha) |
|---|---|---|---|---|---|---|
| 1 | 886.172 | 61.894 | 2785.693 | 61.743 | 2.370 | 0.040 |
| 10 | 2660.167 | 55.182 | 1012.053 | 53.515 | 6.267 | 0.143 |
| 20 | 2989.640 | 48.996 | 677.920 | 47.260 | 7.656 | 0.239 |
| 30 | 3086.898 | 35.336 | 582.663 | 32.682 | 8.765 | 0.230 |
# Exercise 1 figure 1 code here
# Please adapt the figure caption as well.
ggplot(prac2_ex1_tidy, aes(mean_size, forest_int))+
stat_summary(geom = 'line', color = 'dodgerblue', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Mean harvest size (ha)', y = 'Forest interior (ha)', title = 'Forest Interior')+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 1
# Exercise 1 figure 2 code here
ggplot(prac2_ex1_tidy, aes(mean_size, forest_edge))+
stat_summary(geom = 'line', color = 'dodgerblue', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Mean harvest size (ha)', y = 'Mean forest edge (ha)', title = 'Mean Forest Edge')+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 2
# Exercise 1 figure 3 code here
ggplot(prac2_ex1_tidy, aes(mean_size, mean_patch_size))+
stat_summary(geom = 'line', color = 'dodgerblue', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Mean harvest size (ha)', y = 'Mean patch size (ha)', title = 'Mean Patch Size')+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 3
1. Did the amount of forest interior habitat increase or decrease with increasing harvest coupe size?
Forest interior habitat increased with harvest coupe size.
2. What was the response of forest edge habitat to changes in harvest coupe size?
Mean forest edge decreased with harvest coupe size.
3. Did you detect a threshold effect for mean coupe size for any of the three variables assessed? If so, at what coupe size did the threshold occur at?
For coupe sizes greater than 10ha, all variables showed reduced change, indicating 10ha as a potential threshold.
4. As a conservation biologist you have been tasked with advising a forest manager the appropriate harvest size that maximises forest interior habitat for an endangered species. What policy would you recommend?
According to figure 1, harvests have the least impact on forest interior area when concentrated into fewer, larger coupe sizes. More dispersed harvests increase patch number and edge habitat (figures 2 and 3) and may have additional fragmentation effects through creation of road infrastructure. Therefore, in this scenario, conservation policies should recommend at least ~30ha coupes rather than many dispersed harvest areas.
# Exercise 2 table
prac2_ex2<-read.csv('data/prac2_student_ex2.csv')
prac2_ex2_tidy<-prac2_ex2%>%select(1, harv_area = 2, forest_int = 3, forest_edge = 4, mean_patch_size = 5)
prac2_ex2_summary<-prac2_ex2_tidy%>%
group_by(harv_area)%>%
summarise(mean_forest_interior = mean(forest_int),
sd_forest_interior = sd(forest_int),
mean_forest_edge = mean(forest_edge),
sd_forest_edge = sd(forest_edge),
mean_patch = mean(mean_patch_size),
sd_patch = sd(mean_patch_size))
#To create a nice looking table in rmarkdown, use the `kable` function:
knitr::kable(prac2_ex2_summary,
caption = "Summary table", #don't forget the caption!
digits = 3,
col.names = c('Mean harvest size (ha)',
'Mean forest interior (ha)',
'Std. dev. Forest int. (ha)',
'Mean forest edge (ha)',
'Std. dev. forest edge (ha)',
'Mean patch size (ha)',
'Std. dev. patch size (ha)'))
| Mean harvest size (ha) | Mean forest interior (ha) | Std. dev. Forest int. (ha) | Mean forest edge (ha) | Std. dev. forest edge (ha) | Mean patch size (ha) | Std. dev. patch size (ha) |
|---|---|---|---|---|---|---|
| 1 | 3171.155 | 33.080 | 654.615 | 34.547 | 8.545 | 0.189 |
| 3 | 2253.655 | 70.893 | 1416.827 | 71.054 | 4.797 | 0.106 |
| 5 | 1628.427 | 98.931 | 1887.377 | 99.799 | 3.370 | 0.066 |
| 7 | 1094.332 | 57.991 | 2265.678 | 57.882 | 2.589 | 0.035 |
# Exercise 2 figure 1 code here
# Please adapt the figure caption as well.
ggplot(prac2_ex2_tidy, aes(harv_area, forest_int))+
stat_summary(geom = 'line', color = 'dodgerblue', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Mean harvest size (ha)', y = 'Forest interior (ha)', title = 'Forest Interior')+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 4
# Exercise 2 figure 2 code here
ggplot(prac2_ex2_tidy, aes(harv_area, forest_edge))+
stat_summary(geom = 'line', color = 'dodgerblue', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Mean harvest size (ha)', y = 'mean forest edge (ha)', title = 'Mean Forest Edge')+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 5
# Exercise 2 figure 3 code here
ggplot(prac2_ex2_tidy, aes(harv_area, mean_patch_size))+
stat_summary(geom = 'line', color = 'dodgerblue', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Mean harvest size (ha)', y = 'Mean patch size (ha)', title = 'Mean Patch Size')+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 6
5. Did the amount of forest interior habitat increase or decrease with increasing are of forest cut per decade?
Interior habitat decreased with increased harvests.
6. Was the response of linear or non-linear?
Almost linear, monotonic decrease.
7. Did you detect a threshold effect for percent forest area cut for any of the three variables assessed? If so, at what level of cutting did the threshold occur at?
Mean patch size shows reduced change after 3ha of forest area cut indicating a potential threshold effect at this size.
8. Compare this result to the analyses done with Mean Coupe Size, was there a different response? If so, how did they differ?
The results of mean coupe size and percentage of forest cut are inversely related. Forest interior increased with larger coupe sizes (figure 1), while decreasing with higher percentage of forest cut (figure 4).
Similarly, mean forest edge negatively correlated with larger coupe sizes (figure 2), while positively correlating with higher percentage of forest cut (figure 5).
Finally, mean patch size increased with larger coupe sizes (figure 3) and decreased with higher percentage of forest cut (figure 6).
# Exercise 3 table
prac2_ex3<-read.csv('data/prac2_student_ex3.csv')
prac2_ex3_tidy<-prac2_ex3%>%select(1, disp_method = 2, forest_int = 3, forest_edge = 4, mean_patch_size = 5)
#don't forget to create the summary table after loading the data! See above code for guidance :)
ggplot(prac2_ex3_tidy, aes(disp_method, forest_int))+
stat_summary(geom = 'bar', fill = 'dodgerblue', width = 0.6)+
stat_summary(geom = 'errorbar', width = 0.1)+
coord_cartesian(ylim=c(2000, max(prac2_ex3_tidy$forest_int)))+ #This forces the plot to not start at 0 - find the best min ylim value for your data!
labs(x = '',y = 'Forest interior (ha)', title = 'Forest Interior')+
scale_x_discrete(labels = c("Clumped","Dispersed"))+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
# Exercise 3 table
prac2_ex3<-read.csv('data/prac2_student_ex3.csv')
prac2_ex3_tidy<-prac2_ex3%>%select(1, disp_method = 2, forest_int = 3, forest_edge = 4, mean_patch_size = 5)
#don't forget to create the summary table after loading the data! See above code for guidance :)
ggplot(prac2_ex3_tidy, aes(disp_method, forest_edge))+
stat_summary(geom = 'bar', fill = 'dodgerblue', width = 0.6)+
stat_summary(geom = 'errorbar', width = 0.1)+
coord_cartesian(ylim=c(500, max(prac2_ex3_tidy$forest_edge)))+ #This forces the plot to not start at 0 - find the best min ylim value for your data!
labs(x = '',y = 'Mean Forest Edge (ha)', title = 'Mean Forest Edge')+
scale_x_discrete(labels = c("Clumped","Dispersed"))+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 2
# Exercise 3 figure 2 code here
# Exercise 3 figure 3 code here
ggplot(prac2_ex3_tidy, aes(disp_method, mean_patch_size))+
stat_summary(geom = 'bar', fill = 'dodgerblue', width = 0.6)+
stat_summary(geom = 'errorbar', width = 0.1)+
coord_cartesian(ylim=c(4, max(prac2_ex3_tidy$mean_patch_size)))+ #This forces the plot to not start at 0 - find the best min ylim value for your data!
labs(x = '',y = 'Mean Patch Size (ha)', title = 'Mean Patch Size')+
scale_x_discrete(labels = c("Clumped","Dispersed"))+
theme_bw()
## No summary function supplied, defaulting to `mean_se()`
## No summary function supplied, defaulting to `mean_se()`
Figure 3
#Add any other R code you used in this exercise here
9. Does the clustering of harvesting significantly change the amount of interior habitat? What about edge habitat? Mean Patch Size? Are the differences significant? Bonus point for providing a P value for the test between dispersed and clumped for each metric!
Clustered harvests resulted in significantly higher amounts of forest interior than dispersed harvests (2889ha vs 2344ha), significantly less edge habitat (782ha vs 1328ha) and marginally higher patch size (5.2ha vs 4.8ha).
# Exercise 4 figure 1 code here
# Please adapt the figure caption as well.
prac2_ex4<-read.csv('data/prac2_student_ex4.csv')
prac2_ex4%>%
select(opening = 1, edge_buffer = 2, forest_int = 3)%>%
filter(opening == 10)%>%
ggplot(aes(as.factor(edge_buffer), forest_int, fill = as.factor(edge_buffer)))+
geom_bar(stat = 'identity', width = 0.6)+
labs(x = '',
y = 'Forest interior (ha)',
title = 'Forest interior - Persistence = 10 years',
fill = 'Edge buffer \nwidth (m)')+
scale_y_continuous(expand = c(0,0), limits = c(0, 4000))+#this lets the bars start on the 0 line
theme_bw()+
theme(axis.text.x = element_blank())
Figure 1
# Exercise 4 figure 2 code here
prac2_ex4<-read.csv('data/prac2_student_ex4.csv')
prac2_ex4%>%
select(opening = 1, edge_buffer = 2, forest_int = 3)%>%
filter(opening == 30)%>%
ggplot(aes(as.factor(edge_buffer), forest_int, fill = as.factor(edge_buffer)))+
geom_bar(stat = 'identity', width = 0.6)+
labs(x = '',
y = 'Forest interior (ha)',
title = 'Forest interior - Persistence = 30 years',
fill = 'Edge buffer \nwidth (m)')+
scale_y_continuous(expand = c(0,0), limits = c(0, 4000))+#this lets the bars start on the 0 line
theme_bw()+
theme(axis.text.x = element_blank())
Figure 2
10. Does an increase in edge-buffer width have a significant effect on area of interior habitat? Why or why not?
Increase in edge-buffer width resulted in a decrease in interior habitat with 10 year persistence times and significant decrease in interior habitat with 30 year persistence times.
11. Does changing opening persistence time influence area of interior habitat? Why or why not?
Area of interior habitat decreases with longer opening persistence times due to slower interior forest regrowth.
12. For species that are very sensitive to the presence of edge habitat, thereby requiring a large edge buffer, what recommendations would you make to the forest manager for conserving habitat? Would your advice change if openings persisted for 10 years versus 30 years?
Forest managers should maximise interior habitat to protect species sensitive to edge habitat. Figure 1 and 2 show that smaller edge buffers (0-150m) allow for higher amounts of interior habitat. Further, figure 2 shows that forest interior significantly decreases with longer persistence times. Therefore, forest managers should use smaller edge buffers which scale according with persistance times (longer persistence = smaller buffer) to conserve interior habitat.