-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo_report.Rmd
210 lines (149 loc) · 6.28 KB
/
demo_report.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
title: "LANDFIRE-Powered Report for LTA `r params$MAP_UNIT_S` "
author: "Randy Swaty"
date: "2023-02-20"
output:
html_document:
theme: flatly
toc: yes
toc_float:
collapsed: true
params:
MAP_UNIT_SYMBOL: "223Ba01"
---
```{r setup, message=FALSE, warning=FALSE, include=FALSE}
library(tidyverse)
library(stringr)
library(crosstalk)
library(ggsci)
library(scales)
library(plotly)
data <- read_csv("bps_evt_ltas_hoosier.csv") %>%
mutate(ACRES = Count*0.222)
bps_transitions <- read.csv("bps_transitions.csv")
bps_scls_ref_cur_ltas <- read_csv("data/bps_scls_ref_cur_ltas.csv")
```
## General Background to this report
Using data from the [LANDFIRE](https://landfire.gov/) program we drafted these LTA-specific reports that depict:
* How many acres of the most prevalent historical ecosystems (called "Biophysical Settings", BpS) were present just prior to European colonization
* How many acres of the most prevalent current ecosystems (called "Existing Vegetation Types") were present ca2020
* Past vs. current succession class amounts for 3 most prevalent BpSs
*These charts provided as a demo only. Local review and interpretation will be key to success!*
<br>
## Top 10 Biophysical Settings
```{r bps chart, message=FALSE, warning=FALSE, echo=FALSE, fig.width=10, fig.height=10}
bpsname <- data %>%
filter(MAP_UNIT_SYMBOL == params$MAP_UNIT_SYMBOL) %>%
group_by(BPS_NAME) %>%
summarize(ACRES = sum(ACRES)) %>%
arrange(desc(ACRES)) %>%
top_n(n = 10, wt = ACRES)
# plot
bpsChart <-
ggplot(data = bpsname, aes(x = BPS_NAME, y = ACRES)) +
geom_bar(stat = "identity", fill = "#183d1f") +
labs(
subtitle = "Represents dominant vegetation systems pre-European colonization",
caption = "Data from landfire.gov.",
x = "",
y = "Acres") +
scale_x_discrete(limits = rev(bpsname$BPS_NAME),
labels = function(x) str_wrap(x, width = 18)) +
scale_y_continuous(labels = comma) +
coord_flip() +
theme_bw(base_size = 14)
bpsChart
```
<br>
**Learn more about Biophysical Settings:**
* LANDFIRE description of the [Spatial Data](https://landfire.gov/vegetation/bps)
* LANDFIRE description of the [Descriptions and Models](https://landfire.gov/vegetation/bps-models)
* Blankenship et al., (2021) [paper](https://esajournals.onlinelibrary.wiley.com/doi/pdf/10.1002/ecs2.3484) describing development of the models and descriptions.
<br>
## Top 10 Existing Vegetation Types
```{r evt chart, message=FALSE, warning=FALSE, echo=FALSE, fig.width=10, fig.height=10}
evtname <- data %>%
filter(MAP_UNIT_SYMBOL == params$MAP_UNIT_SYMBOL) %>%
group_by(EVT_NAME) %>%
summarize(ACRES = sum(ACRES)) %>%
arrange(desc(ACRES)) %>%
top_n(n = 10, wt = ACRES)
# plot
evtChart <-
ggplot(data = evtname, aes(x = EVT_NAME, y = ACRES)) +
geom_bar(stat = "identity", fill = "#0e1624") +
labs(
subtitle = "Represents dominant vegetation systems ~2020",
caption = "Data from landfire.gov.",
x = "",
y = "Acres") +
scale_x_discrete(limits = rev(evtname$EVT_NAME),
labels = function(x) str_wrap(x, width = 18)) +
scale_y_continuous(labels = comma) +
coord_flip() +
theme_bw(base_size = 14)
evtChart
```
<br>
**Learn more about Existing Vegetation Types:**
* LANDFIRE description of the [concept and spatial data](https://landfire.gov/vegetation/evt)
* [Descriptions](https://landfire.gov/sites/default/files/documents/LANDFIRE_Ecological_Systems_Descriptions_CONUS.pdf) of the Ecological Systems mapped in this dataset
## Reference vs. current succession classes for most prevalent Biophysical Settings
The following chart illustrates modeled "Reference" percentages compared to mapped current percentages of [LANDFIRE Succession Classes](https://landfire.gov/vegetation/sclass) for the top 3 Biophysical Settings in the LTA. The charts are illustrative only. To understand what the succession classes represent it is necessary to read the descriptions that are downloadable [here](https://landfirereview.org/search.php).
<br>
```{r scls chart, message=FALSE, warning=FALSE, echo=FALSE, fig.width=10, fig.height=6}
one_lta_wrangled <- bps_scls_ref_cur_ltas %>%
filter(MAP_UNIT_SYMBOL == params$MAP_UNIT_SYMBOL) %>%
group_by(bps_aoi) %>%
mutate(total.count = sum(Count)) %>%
ungroup() %>%
dplyr::filter(dense_rank(desc(total.count)) < 4) %>%
dplyr::select(c("BpS_Name", "refLabel", "currentPercent", "refPercent")) %>%
pivot_longer(
cols = c(`refPercent`, `currentPercent`),
names_to = "refCur",
values_to = "Percent"
)
# order classes
one_lta_wrangled$refLabel <- factor(one_lta_wrangled$refLabel, levels= c(
"Developed",
"Agriculture",
"UE",
"UN",
"E",
"D",
"C",
"B",
"A"))
sclasplot <-
ggplot(one_lta_wrangled, aes(fill=factor(refCur), y=Percent, x=refLabel)) +
geom_col(width = 0.8, position = position_dodge()) +
coord_flip() +
facet_grid(. ~BpS) +
scale_x_discrete(limits = (levels(one_lta_wrangled$refLabel))) +
labs(
title = "Succession Classes past and present",
subtitle = "3 BpSs selected for illustration. Not all succession classes present in all BpSs",
caption = "\nData from landfire.gov.",
x = "",
y = "Percent")+
theme_minimal(base_size = 12)+
theme(plot.caption = element_text(hjust = 0, face= "italic"), #Default is hjust=1
plot.title.position = "plot", #NEW parameter. Apply for subtitle too.
plot.caption.position = "plot") +
scale_fill_manual(values = c("#3d4740", "#32a852" ), # present (grey), historical (green)
name = " ",
labels = c("Present",
"Past")) +
facet_wrap(~BpS_Name, nrow(3),labeller = labeller(BpS_Name = label_wrap_gen())) +
theme(panel.spacing = unit(.05, "lines"),
panel.border = element_rect(color = "black", fill = NA, size = 1),
strip.background = element_rect(color = "black", size = 1))
sclasplot
```
<br>
To learn more about succession class comparisons:
* Swaty et al., (2021) [paper](https://www.mdpi.com/2073-445X/11/1/28/pdf) describing application of model results in calculation of Vegetation Departure
* LANDFIRE description of [succession classes](https://landfire.gov/vegetation/sclass)
<br>
