forked from aaronweed/APPAForesthealthReport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scratch.R
36 lines (32 loc) · 1.12 KB
/
scratch.R
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
# ggplot() +
# geom_sf(data = eco_sf, aes(fill = n_plots)) +
# geom_sf(data = at_centerline) +
# theme_minimal() +
# scale_fill_viridis_c() +
# labs(fill = "Number of FIA plots",
# title = "Number of FIA Plots Per Ecosubsection")
div_year %>%
ggplot(aes(x = MEASYEAR, y = H_a)) +
geom_point() +
geom_line() +
facet_wrap(~SUBSECTION)
pal <- colorBin("Purples", domain = div[["H_a"]], bins = 9)
div %>%
left_join(eco_sf_transformed) %>%
st_as_sf() %>%
leaflet() %>%
addTiles() %>%
addPolygons(fillColor = ~ pal(div[["H_a"]]),
fillOpacity = 1,
opacity = 0,
popup = paste0("<b>Ecosubsection: </b>",
div[["SUBSECTION"]],
"<br> <b>mean Shannon's Diversity Index,<br> alpha (stand) level: </b>",
round(div[["H_a"]], 3))) %>%
addPolylines(data = at_centerline,
color = "black",
opacity = 1,
weight = 2) %>%
addLegend(pal = pal,
values = ~div[["H_a"]],
title = "mean Shannon's Diversity Index, alpha (stand) level")