prac2_ex1_summary<-prac2_ex1_tidy%>%
group_by(mean_harvest_size)%>%
summarise(mean_forest_interior = mean(forest_interior_area),
sd_forest_interior = sd(forest_interior_area),
mean_forest_edge = mean(forest_edge_area),
sd_forest_edge = sd(forest_edge_area),
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 = "Table 1: The mean and standard deviation values of a range of forest area metrics (in hectares) including forest interior, forest edge, and mean patch size highlighting the response to changes in harvest size (in hectares).",
digits = 2,
col.names = c('Mean harvest size (ha)',
'Mean forest interior area (ha)',
'Std. dev. Forest interior area (ha)',
'Mean forest edge area (ha)',
'Std. dev. forest edge area (ha)',
'Mean patch size (ha)',
'Std. dev. patch size (ha)'))
| Mean harvest size (ha) | Mean forest interior area (ha) | Std. dev. Forest interior area (ha) | Mean forest edge area (ha) | Std. dev. forest edge area (ha) | Mean patch size (ha) | Std. dev. patch size (ha) |
|---|---|---|---|---|---|---|
| 1 | 896.81 | 57.31 | 2774.86 | 57.10 | 2.38 | 0.04 |
| 10 | 2664.45 | 57.27 | 1006.58 | 56.14 | 6.31 | 0.17 |
| 20 | 2980.15 | 55.00 | 686.92 | 53.19 | 7.66 | 0.23 |
| 30 | 3079.60 | 33.91 | 586.92 | 29.11 | 8.77 | 0.22 |
ggplot(prac2_ex1_tidy, aes(mean_harvest_size, forest_interior_area))+
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 Area (ha)', title = 'Total Forest Interior Area (ha)', caption = 'Figure 1: Plot showing the relationship between mean harvest size (in hectares) and forest interior area (in hectares).') +
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()`
Text
ggplot(prac2_ex1_tidy, aes(mean_harvest_size, forest_edge_area))+
stat_summary(geom = 'line', color = 'red', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Mean Harvest Size (ha)', y = 'Forest Edge Area (ha)', title = 'Total Forest Edge Area (ha)', caption = 'Figure 2: Plot showing the relationship between mean harvest size (in hectares) and forest edge area (in hectares).')+
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()`
Text
ggplot(prac2_ex1_tidy, aes(mean_harvest_size, mean_patch_size))+
stat_summary(geom = 'line', color = 'green', 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 (ha)', caption = 'Figure 2: Plot showing the relationship between mean harvest size (in hectares) and Mean Patch Size (in hectares).')+
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()`
Text
1. Did the amount of forest interior habitat increase or decrease with increasing harvest coupe size? Forest interior size increased with mean harvest size. The forest interior size at a harvest size of 1 hectare was less than 1000 hectares, and increased three fold to over 3000 hectares when the harvest size increased to 20-30 hectares. Therefore the amount of forest interior habitat increases with increasing harvest coupe size.
2. What was the response of forest edge habitat to changes in harvest coupe size? Forest edge size decreased with an increase to mean harvest size. The forest edge size at a harvest size of 1 hectare was more than 2500 hectares, and decreased dramatically, halving to around 1000 hectares when the harvest size increased to 10 hectares and further decreased when the harvest size increased to 20 and 30 hectares. Therefore the forest edge habitat decreased in response to an increase in 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? Yes there was a threshold effect for all three variables assessed. Dramatic changes in forest interior area, forest edge area and Mean patch size all occurred across a harvest size of 1 to 10 hectares. The threshold effect occurred between 1 to 10 ha coupe size, thus at a coupe size of 10 hectares since an increase in couple size from 1 to 10 ha dramatically changed the response in all 3 of the variables.
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? To maximise forest interior habitat I would recommend to the forest manager a policy where the harvest size is at least 20 hectares. A harvest size of around 30 hectares would be optimal since at this size, the forest interior area is at its largest, the forest edge area is far lower and the average patch size is at its highest value. The interior area, and forest edge area don’t change much with 30 hectares of havested area as opposed to 20 hectares thus it may potentially be cheaper/easier and more manageble for the forest manager to only harvest less than 30 hectares despite that seeming like the optimal area size to harvest.
prac2_ex2<-read.csv('data/prac2_student_ex2.csv')
#tidy up the data#tifile = dy up the data
prac2_ex2_tidy<-prac2_ex2%>%select(1, percent_forest_cut = 2, forest_interior_area = 3, forest_edge_area = 4, mean_patch_size = 5) #select lets you modify the number and position of columns, but also let's you rename them!
prac2_ex2_summary<-prac2_ex2_tidy%>%
group_by(percent_forest_cut)%>%
summarise(mean_forest_interior = mean(forest_interior_area),
sd_forest_interior = sd(forest_interior_area),
mean_forest_edge = mean(forest_edge_area),
sd_forest_edge = sd(forest_edge_area),
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 = "Table 1: The mean and standard deviation values of a range of forest area metrics (in hectares) including forest interior, forest edge, and mean patch size highlighting the response to changes in different levels of forest cutting (in %).",
digits = 2,
col.names = c('Percent of forest cut (%)',
'Mean forest interior area (ha)',
'Std. dev. Forest interior area (ha)',
'Mean forest edge area (ha)',
'Std. dev. forest edge area (ha)',
'Mean patch size (ha)',
'Std. dev. patch size (ha)'))
| Percent of forest cut (%) | Mean forest interior area (ha) | Std. dev. Forest interior area (ha) | Mean forest edge area (ha) | Std. dev. forest edge area (ha) | Mean patch size (ha) | Std. dev. patch size (ha) |
|---|---|---|---|---|---|---|
| 1 | 3170.40 | 33.45 | 654.91 | 34.70 | 8.54 | 0.18 |
| 3 | 2255.57 | 69.90 | 1414.94 | 70.03 | 4.81 | 0.11 |
| 5 | 1641.69 | 96.51 | 1874.16 | 97.41 | 3.37 | 0.07 |
| 7 | 1095.73 | 56.99 | 2264.42 | 56.99 | 2.58 | 0.03 |
ggplot(prac2_ex2_tidy, aes(percent_forest_cut, forest_interior_area))+
stat_summary(geom = 'line', color = 'dodgerblue', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Percent Forest Cut (%)', y = 'Forest Interior Area (ha)', title = 'Total Forest Interior Area (ha)', caption = 'Figure 1: Plot showing the relationship between the level of forest cutting (in %) and forest interior area (in hectares).') +
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()`
Text
ggplot(prac2_ex2_tidy, aes(percent_forest_cut, forest_edge_area))+
stat_summary(geom = 'line', color = 'red', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Percent Forest Cut (%)', y = 'Forest Edge Area (ha)', title = 'Total Forest Edge Area (ha)', caption = 'Figure 2: Plot showing the relationship between the level of forest cutting (in %) and forest edge area (in hectares).')+
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()`
Text
ggplot(prac2_ex2_tidy, aes(percent_forest_cut, mean_patch_size))+
stat_summary(geom = 'line', color = 'green', lwd = 2)+
stat_summary(geom = 'point', size = 2)+
stat_summary(geom = 'errorbar', width = 0.8)+
labs(x = 'Percent Forest Cut (%)', y = 'Mean Patch Size (ha)', title = 'Mean Patch Size (ha)', caption = 'Figure 3: Plot showing the relationship between the level of forest cutting (in %) and Mean Patch Size (in hectares).')+
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()`
Text
5. Did the amount of forest interior habitat increase or decrease with increasing area of forest cut per decade? The amount of forest interior habitat decreased with increasing area of forest cut per decade. It decreased dramatically from over 3000 ha to just over 1000 ha when going from 1% forest cut to 7%.
6. Was the response of linear or non-linear? For forest interior the response appears to be a negative linear relationship For forest edge the response appears to be positive linear relationship For mean patch size the response appears to to be a negative non-linear relationship
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? There doesn’t seem to be a threshold effect for forest interior area or forest edge area. However, there does seem to be a threshold effect for percent forest area cut on the mean patch size. At 1% level of cutting the mean patch size is over 8 ha, whilst at an increase in cutting to 3% the mean patch size almost halves and then decreases but not as dramatically with further increases in cutting. The level of cutting where the threshold occurs at is between 1% and 3%, thus is at 3% where forest cutting passes the threshold effect on mean patch size.
8. Compare this result to the analyses done with Mean Coupe Size, was there a different response? If so, how did they differ?
Yes there was a different response when comparing the forest interior: The forest interior area increased with an increase in mean coupe size, whilst decreasing with an increase in the level of cutting. The response was positive and non-linear in the mean coupe size analysis whilst it was negative and linear in the level of cutting analysis.
Yes there was a different response when comparing the forest edge: The forest edge area decreased with an increase in mean coupe size, whilst increasing with an increase in the level of cutting. The response was negative and non-linear in the mean coupe size analysis whilst it was positive and linear in the level of cutting analysis.
Yes there was a different response when comparing the mean patch size: The mean patch size increased with an increase in mean coupe size, whilst decreasing with an increase in the level of cutting. The response was positive and non-linear in the mean coupe size analysis whilst it was negative, it was similar in regards to the non-linear nature in the level of cutting analysis.
prac2_ex3<-read.csv('data/prac2_student_ex3.csv')
#tidy up the data#tifile = dy up the data
prac2_ex3_tidy<-prac2_ex3%>%select(1, dispersion_method = 2, forest_interior_area = 3, forest_edge_area = 4, mean_patch_size = 5) #select lets you modify the number and position of columns, but also let's you rename them!
prac2_ex3_summary<-prac2_ex3_tidy%>%
group_by(dispersion_method)%>%
summarise(mean_forest_interior = mean(forest_interior_area),
sd_forest_interior = sd(forest_interior_area),
mean_forest_edge = mean(forest_edge_area),
sd_forest_edge = sd(forest_edge_area),
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_ex3_summary,
caption = "Table 1: The mean and standard deviation values of a range of forest area metrics (in hectares) including forest interior, forest edge, and mean patch size highlighting the response to differing dispersion methods.",
digits = 2,
col.names = c('Dispersion method',
'Mean forest interior area (ha)',
'Std. dev. Forest interior area (ha)',
'Mean forest edge area (ha)',
'Std. dev. forest edge area (ha)',
'Mean patch size (ha)',
'Std. dev. patch size (ha)'))
| Dispersion method | Mean forest interior area (ha) | Std. dev. Forest interior area (ha) | Mean forest edge area (ha) | Std. dev. forest edge area (ha) | Mean patch size (ha) | Std. dev. patch size (ha) |
|---|---|---|---|---|---|---|
| clumped | 2812.17 | 102.45 | 858.50 | 103.65 | 5.06 | 0.12 |
| dispersed | 2278.50 | 46.30 | 1393.83 | 45.89 | 4.96 | 0.09 |
ggplot(prac2_ex3_tidy, aes(dispersion_method, forest_interior_area))+
stat_summary(geom = 'bar', color = 'dodgerblue', width = 0.6)+
stat_summary(geom = 'errorbar', width = 0.1)+
coord_cartesian(ylim=c(2000, max(prac2_ex3_tidy$forest_interior_area)))+
labs(x = '', y = 'Forest Interior Area (ha)', title = 'Total Forest Interior Area (ha)', caption = 'Figure 1: Plot showing the relationship between the dispersion method and forest interior area (in hectares).') +
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()`
Text
ggplot(prac2_ex3_tidy, aes(dispersion_method, forest_edge_area))+
stat_summary(geom = 'bar', color = 'red', width = 0.6)+
stat_summary(geom = 'errorbar', width = 0.1)+
coord_cartesian(ylim=c(500, max(prac2_ex3_tidy$forest_edge_area)))+
labs(x = '', y = 'Forest Edge Area (ha)', title = 'Total Forest Edge Area (ha)', caption = 'Figure 2: Plot showing the relationship between the dispersion method and forest edge area (in hectares).')+
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()`
Text
ggplot(prac2_ex3_tidy, aes(dispersion_method, mean_patch_size))+
stat_summary(geom = 'bar', color = 'green', width = 0.6)+
stat_summary(geom = 'errorbar', width = 0.1)+
coord_cartesian(ylim=c(4.5, max(prac2_ex3_tidy$mean_patch_size)))+
labs(x = '', y = 'Mean Patch Size (ha)', title = 'Mean Patch Size (ha)', caption = 'Figure 3: Plot showing the relationship between the dispersion method and Mean Patch Size (in hectares).')+
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()`
Text
prac2_ex3_ordered <- prac2_ex3[order(prac2_ex3$dispersion.method), ]
clumped_interior<-c(prac2_ex3_ordered$forest.interior..ha.[1:6])
clumped_edge<-c(prac2_ex3_ordered$forest.edge..ha.[1:6])
clumped_patch<-c(prac2_ex3_ordered$Mean.patch.size[1:6])
dispersed_interior<-c(prac2_ex3_ordered$forest.interior..ha.[7:12])
dispersed_edge<-c(prac2_ex3_ordered$forest.edge..ha.[7:12])
dispersed_patch<-c(prac2_ex3_ordered$Mean.patch.size[7:12])
t.test(clumped_edge,dispersed_interior) #p-value = 1.199e-08
##
## Welch Two Sample t-test
##
## data: clumped_edge and dispersed_interior
## t = -30.64, df = 6.9192, p-value = 1.199e-08
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1529.846 -1310.154
## sample estimates:
## mean of x mean of y
## 858.5 2278.5
t.test(clumped_interior,dispersed_edge) #p-value = 1.097e-08
##
## Welch Two Sample t-test
##
## data: clumped_interior and dispersed_edge
## t = 30.948, df = 6.929, p-value = 1.097e-08
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 1309.739 1526.928
## sample estimates:
## mean of x mean of y
## 2812.167 1393.833
t.test(clumped_patch,dispersed_patch) #p-value = 0.1405
##
## Welch Two Sample t-test
##
## data: clumped_patch and dispersed_patch
## t = 1.6079, df = 9.5231, p-value = 0.1405
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.03820459 0.23153792
## sample estimates:
## mean of x mean of y
## 5.055000 4.958333
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!
The clustering of harvesting significantly increases the total forest internal area with a p value of 1.199e-08. When using a clumped dispersion method, the amount of interior habitat is far larger than when the harvesting method is dispersed.
The clustering of harvesting significantly decreases the total forest edge area with a p value of 1.097e-08 indicating a strong correlation between clustering and expansion of forest edge areas. When using a clumped dispersion method, the amount of edge area is far smaller than when the harvesting method is dispersed.
While the clustering of harvesting appears to potentially increase the mean patch size, this effect lacks statistical significance at an alpha level of 0.05 (p-value = 0.1405)
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)',
caption = 'Figure 1: Plot showing the relationship between the edge buffer (in m) and the persistence of
forest internal area (in hectares) after 10 years.')+
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())
Text
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)',
caption = 'Figure 2: Plot showing the relationship between the edge buffer and the persistence of
forest internal area (in hectares) after 30 years.')+
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())
Text
It is possible to create both bar graphs with one code using facet_grid(). Can you figure out how? 1 extra point for faceted solution :) Make sure to label the facets correctly! If you’re not sure how faceting in ggplot works, type ?facet_grid to the console.
prac2_ex4 %>%
select(opening = 1, edge_buffer = 2, forest_int = 3) %>%
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)',
fill = 'Edge buffer \nwidth (m)',
caption = 'Figure 3: Plot showing the relationship between the edge buffer and the persistence of
forest internal area (in hectares)') +
scale_y_continuous(expand = c(0,0), limits = c(0, 4000)) +
theme_bw() +
theme(axis.text.x = element_blank()) +
facet_grid(~ opening, labeller = labeller(opening = c("10" = "Persistence of 10 years", "30" = "Persistence of 30 years")))
Text
10. Does an increase in edge-buffer width have a significant effect on area of interior habitat? Why or why not? Yes. An increase in edge-buffer width decreases the total amount of interior area of the forest. Larger edge buffers lead to there being less interior habitat
11. Does changing opening persistence time influence area of interior habitat? Why or why not? Yes. The edge effect persists for some time, and extending the opening persistence time has a negative impact on the interior habitat of the forest. A longer opening persistence time reduces the forest interior habitat when the edge buffer width is kept constant.
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? I would recommend that the forest manager implemented a strategy whereby they focused on keeping the edge buffer width of the forest as wide as possible, at least >150m with around 300m being ideal, which would minimize the influence of edge conditions on the core habitat.Yes I would change my advice if openings persisted for longer. My focus would be the long-term sustainability of the habitat for the sensitive species rather than the more tempoary mesures of a shorter opening. If openings persisted for longer I would emphasize the creation of stable interior habitat patches and recommend that the edge buffer be even larger.