-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomparing.qmd
172 lines (128 loc) · 5.93 KB
/
comparing.qmd
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
---
title: "Comparisons"
---
```{r include=FALSE, echo=FALSE, message=FALSE, warning=FALSE}
library(chorddiag)
library(htmlwidgets)
library(igraph)
library(readr)
library(tidygraph)
library(tidyverse)
```
## Comparing Past vs. Present Conditions
Using LANDFIRE’s BpS products, we explore two different ways to visualize past vs. current vegetation patterns.
- First, we present **changes in broad ecosystem types** using an interactive comparison diagram. To present these broad ecosystem trends more effectively, we combined classifications of Existing Vegetation Types (EVT) into broader categories.
- Second, we compare **amounts of succession classes** (past and present) for the most prevalent ecosystems.
## Summary
There has not been broad whole conversion of ecosystems from one to another (explore circular chord diagram below). However, due to harvests, fire suppression and other management actions (in addtion to changes in natural processes) there have been some notable changes in succession classes (see "Succession classes for most dominant Biophysical Settings") section below:
* Perhaps the most interesting broad-scale change is conversion of 'conifer' types to 'hardwood', presumably due to fire suppression.
* Some ecosystems have sizable over/under-representation of successin classes on the landscape today compared to modeled historic. For example:
* Laurentian-Acadian Northern Hardwoods Forest - Hemlock is missing succession class D
* Classes A-C under represented in the Boreal Jack Pine-Black Spruce Forest - Pine Barrens
* Class A and B under reprented in the Boreal Acidic Peatland Systems
These differences may or may not be 'real' on the ground and/or may not be a management priority.
## Looking at broad changes, vegetation conversion
This interactive 'chord' diagram allows you to explore changes on the landscape. To use:
* Hover over the outer bands to see connections. For example, if you over over the dark green outer band of the "Past Conifer" group you can see that some is now mapped as converted, some hardwood, etc., and that the majority is still mapped as conifer.
* Alternatively, if you hover over the orange outer band of "Hardwood" you can see what the present extent of hardwoods vegetation was historically.
* The popups contain acres for the band.
<br>
*Note: number presented when hovering equals acres.*
```{r chord, echo=FALSE, message=FALSE, warning=FALSE, include=FALSE}
# read in data
chord_df <- read_csv("data/bps2evt_chord.csv")
#view(histFireGVchord)
#convert to matrix
matrix_df <-as.matrix(as_adjacency_matrix(as_tbl_graph(chord_df),attr = "ACRES"))
#clean up matrix (could be cleaner!)
matrix_df = subset(matrix_df, select = -c(1:4))
matrix_df <- matrix_df[-c(5:13),]
#make a custom color pallet
# ORIGINAL
groupColors <-c( "#1d4220", # conifer OK
"#56bf5f", # hardwood OK
"#397d3f", # hardwood-conifer OK
"#7db7c7", # riparian OK
"#56bf5f", # hardwood
"#1d4220", # conifer
"#7db7c7", # riparian
"#b0af9e",
"#f5e942",
"#eb4034",
"#397d3f",
"#cdaddb",
"#5e503b"
)
#make chord diagram
chord<-chorddiag(data = matrix_df,
type = "bipartite",
groupColors = groupColors,
groupnamePadding = 10,
groupPadding = 3,
groupnameFontsize = 11 ,
showTicks = FALSE,
margin=150,
tooltipGroupConnector = " ▶ ",
chordedgeColor = "#363533"
)
chord
#save then print to have white background
htmlwidgets::saveWidget(chord,
"chord.html",
background = "white",
selfcontained = TRUE
)
```
<iframe src="chord.html" height="720" width="720" style="border: 1px solid #464646;" allowfullscreen="" allow="autoplay" data-external=".5"></iframe>
<br>
## Succession classes for most dominant Biophysical Settings
```{r scls chart, echo=FALSE, message=FALSE, warning=FALSE, fig.width=10, fig.height=9}
BPS_SCLS2 <- read.csv("data/bpsScls2.csv")
bps_scls_3 <- BPS_SCLS2 %>%
group_by(Var1) %>%
mutate(total.count = sum(Freq)) %>%
ungroup() %>%
dplyr::filter(dense_rank(desc(total.count)) < 7) %>%
dplyr::select(c("BpS_Name", "refLabel", "currentPercent", "refPercent")) %>%
pivot_longer(
cols = c(`refPercent`, `currentPercent`),
names_to = "refCur",
values_to = "Percent"
)
# order classes
bps_scls_3$refLabel <- factor(bps_scls_3$refLabel, levels= c(
"Developed",
"Agriculture",
"UE",
"UN",
"E",
"D",
"C",
"B",
"A"))
sclasplot <-
ggplot(bps_scls_3, 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(bps_scls_3$refLabel))) +
labs(
title = "Succession Classes past and present",
subtitle = "6 BpSs selected for illustration. Not all succession classes present in all BpSs",
caption = "\nData from landfire.gov.",
x = "",
y = "Percent")+
theme_minimal(base_size = 14)+
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
```