-
Notifications
You must be signed in to change notification settings - Fork 0
/
05-answers.Rmd
138 lines (105 loc) · 6.28 KB
/
05-answers.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Answers
This chapter contains the answers to the questions presented in the earlier chapters. The answers are provided here so you can check if your answers are correct.
## Data
### Planning unit data
```{block2, type="rmdanswer"}
1. `nrow(pu_data)`
2. `max(pu_data$cost)`
3. `sum(pu_data$locked_in)`
4. `mean(pu_data$locked_in)`
5. `sum(pu_data$locked_out)`
6. `mean(pu_data$locked_out)`
7. `assert_that(min(c(pu_data$locked_in, pu_data$locked_out)) == 0)`
`assert_that(max(c(pu_data$locked_in, pu_data$locked_out)) == 1)`
8. `all(is.finite(pu_data$cost))`
9. `assert_that(sum(duplicated(pu_data$id)) == 0)`
10. Yes, the eastern side of Tasmania is generally much cheaper than the western side.
11. Yes, most planning units covered by protected areas are located in the south-western side of Tasmania.
```
\clearpage
### Vegetation data
```{block2, type="rmdanswer"}
1. Central-north Tasmania
2. `cellStats(veg_data[[12]], "mean")`
3. `names(veg_data)[which.max(cellStats(veg_data, "sum"))]`
4. Yes, they are the same.
```
## Gap analysis
### Feature abundance
```{block2, type="rmdanswer"}
1. `median(abundance_data$absolute_abundance_km2)`
2. `min(abundance_data$absolute_abundance_km2)`
3. `abundance_data$feature[which.min(abundance_data$absolute_abundance_km2)]`
4. `sum(abundance_data$absolute_abundance_km2)`
5. `sum(abundance_data$absolute_abundance_km2 > set_units(100, km^2))`
```
### Feature representation by protected areas
```{block2, type="rmdanswer"}
1. `mean(repr_data$relative_held, na.rm = TRUE)`
2. `mean(repr_data$absolute_held_km2, na.rm = TRUE)`
3. `repr_data$feature[which.max(repr_data$relative_held)]`
4. `repr_data$feature[which.max(repr_data$absolute_held)]`
5. No, just because a vegetation class is widespread does not necessarily mean that it has the greatest overlap with protected areas. In fact, due to biases in the establishment of protected areas this can often be the case.
6. Yes, the largest protected areas tend to have the great representation (broadly speaking). \newline
`plot(abundance_data$absolute_abundance, repr_data$relative_held)`
7. `sum(repr_data$absolute_held < 1e-10)` (floating point errors)
8. `sum(repr_data$relative_held > 0.1, na.rm = TRUE)`
9. `sum(repr_data$relative_held > 0.2, na.rm = TRUE)`
```
## Spatial prioritizations
### Starting out simple
```{block2, type="rmdanswer"}
1. `sum(s1$solution_1)` \newline
`mean(s1$solution_1)`
2. Yes, the planning units are generally spread out across most of the study area and they are not biased towards specific areas.
3. `all(feature_representation(p1, s1[, "solution_1"])$relative_held >= 0.2)`
```
### Adding complexity
```{block2, type="rmdanswer"}
1. `sum(s2$cost * s2$solution_1)` \newline
`sum(s3$cost * s3$solution_1)` \newline
`sum(s4$cost * s4$solution_1)`
2. `sum(s2$solution_1)` \newline
`sum(s3$solution_1)` \newline
`sum(s4$solution_1)`
3. No, just because a solution a solution has more planning units does not mean that it will cost less.
4. This is because the planning units covered by existing protected areas have a non-zero cost and locking in these planning units introduces inefficiencies into the solution. This is very common in real-world conservation prioritizations because existing protected areas are often in places that do little to benefit biodiversity [@r3].
5. This is because some of the planning units that are highly degraded---based on just the planning unit costs and vegetation data---provide cost-efficient opportunities for meeting the targets and excluding them from the reserve selection process means that other more costly planning units are needed to meet the targets.
6. `sum(s4$cost * s4$solution_1) - sum(s4$cost * s4$locked_in)`
7. We get an error message stating the the problem is infeasible because there is no valid solution---even if we selected all the planning units the study area we would still not meet the targets.
```
### Penalizing fragmentation
```{block2, type="rmdanswer"}
1. The cost of the fourth solution is `sum(s4$solution_1 * s4$cost)` and the cost of the fifth solution is `sum(s5$solution_1 * s5$cost)`. The fifth solution (`s5`) costs more than the fourth solution (`s4`) because we have added penalties to the conservation planning problem to indicate that we are willing to accept a slightly more costly solution if it means that we can reduce fragmentation.
2. The solution is now nearly identical to the fourth solution (`s4`) and so has nearly the same cost. This penalty value is too low and is not useful because it does not reduce the fragmentation in our solution.
3. The solution now contains a lot of extra planning units that are not needed to meet our targets. In fact, nearly every planning unit in the study is now selected. This penalty value is too high and is not useful.
```
### Budget limited prioritizations
```{block2, type="rmdanswer"}
1. `names(veg_data)[which.min(wts)]`
2. `sum(s6$cost * s6$solution_1)` \newline
`sum(s7$cost * s7$solution_1)`
3. No, the sixth (`s6`) and seventh (`s7`) solutions both share many of the same selected planning units and there does not appear to be an obvious difference in the spatial location of the planning units which they do not share.
4. Yes. Both solutions contain adequately represent these features: \newline
`r6$feature[r6$relative_held > 0.2 & r7$relative_held > 0.2]` \newline
The sixth (`s6`) is adequately represents these features too: \newline
`r6$feature[r6$relative_held > 0.2 & !r7$relative_held > 0.2]` \newline
The seventh (`s7`) is adequately represents these features too: \newline
`r7$feature[r7$relative_held > 0.2 & !r6$relative_held > 0.2]`
```
\clearpage
### Solution portfolios
```{block2, type="rmdanswer"}
1. No the cost are very similar. \newline
`sum(s8$solution_1 * s8$cost)` \newline
`sum(s8$solution_2 * s8$cost)` \newline
`sum(s8$solution_3 * s8$cost)` \newline
`sum(s8$solution_4 * s8$cost)` \newline
`sum(s8$solution_5 * s8$cost)` \newline
`sum(s8$solution_6 * s8$cost)`
2. No the status of the planning units are very similar in the all of the solutions in the portfolio. \newline
`mean((s8$solution_1 == s8$solution_2) & (s8$solution_1 == s8$solution_3) &
(s8$solution_1 == s8$solution_4) & (s8$solution_1 == s8$solution_5) &
(s8$solution_1 == s8$solution_6))`
3. We should increase the number of the solutions in the portfolio.
```