#--------Load Packages-----------
pacman::p_load('tidyverse',
'here',
'ggthemes',
'janitor',
'terra',
'tmap',
'patchwork',
'stars',
'rnaturalearth',
'showtext')
#-------- Viani et al. Evaluated glacier lakes from 1930 to 2012 ---------
lake_30 <- read_delim(here('data','VianiC_2018',
'datasets', '1930s_glaciallakes.tab')) %>%
clean_names()
lake_70 <- read_delim(here('data','VianiC_2018',
'datasets', '1970s_glaciallakes.tab'))%>%
clean_names()
lake_80 <- read_delim(here('data','VianiC_2018',
'datasets', '1980s_glaciallakes.tab'))%>%
clean_names()
lake_90 <- read_delim(here('data','VianiC_2018',
'datasets', '1990s_glaciallakes.tab'))%>%
clean_names()
lake_06 <- read_delim(here('data','VianiC_2018',
'datasets', '2006_glaciallakes.tab'))%>%
clean_names()
lake_12 <- read_delim(here('data','VianiC_2018',
'datasets', '2012_glaciallakes.tab'))%>%
clean_names()
# Join all data frames
lake_joined <- bind_rows(list(lake_30, lake_70, lake_80,
lake_06, lake_12))%>%
separate(event, into = c("lake", NA), sep = "_")%>%
filter(lake == 'Miage') # And theres the lake we want
#--------- These next datasets come from the Aosta Geoportal --------
glacier_areas <- st_read(here::here('data',
'u1412_02-19-2026_20-16-06',
'ghiacciai_aree',
'ghiacciai_aree.shp'))
miage_glacier <- glacier_areas %>%
filter(nome == 'GLACIER DU MIAGE') # Filter for miage
miage_label <- miage_glacier[1,]
glacier_lakes <- st_read(here::here('data',
'u1412_02-19-2026_20-16-06',
'ghiacciai_laghi_epiglaciali',
'ghiacciai_laghi_epiglaciali.shp'))
miage <- glacier_lakes %>%
filter(grepl("Miage", nome_lago)) %>%
mutate(anno_rilie = as.integer(as.character(anno_rilie)))
glacier_lakes_2021 <- st_read(here::here('data',
'u1412_02-19-2026_20-16-06',
'ghiacciai_laghi_epiglaciali_2021',
'ghiacciai_laghi_epiglaciali_2021.shp'))
miage_2021 <- glacier_lakes_2021 %>%
filter(grepl("MIAGE", nome)) %>%
mutate(anno_rilie = 2021)
glacier_permimeter <- st_read(here::here('data',
'u1412_02-19-2026_20-16-06',
'ghiacciai_perimetri',
'ghiacciai_perimetri.shp'))
miage_perimeter <- glacier_permimeter %>%
filter(grepl("MIAGE", nome_gs)) %>%
mutate(anno = as.character(anno))
# ---------- Next we created the plot of TOTAL GLACIER AREA as 7 individual plots ------------
years <- c(1820, 1882, 1930, 1947, 1975, 1999, 2005)
lwd_vals <- c(6, 5.5, 4.5, 3.5, 2.5, 1.5, 1)
colors <- RColorBrewer::brewer.pal(7, "Blues")
for(i in seq_along(years)) {
yr <- years[i]
p <- tm_layout(inner.margins = c(0.15, 0, 0, 0)) +
tm_shape(miage_perimeter |> filter(anno == yr),
bbox = st_bbox(miage_perimeter)) +
tm_lines(col = colors[i], lwd = lwd_vals[i])
tmap_save(p, paste0("miage_", yr, ".pdf"))
}
#------------- Next was the Miage lake in 1999 and 2021 ----------------
miage <- miage %>%
filter(anno_rilie == '1999')
miage_2021 <- miage_2021 %>%
filter(!nome %in% c('MIAGE I',
'MIAGE II',
'MIAGE III',
'MIAGE IV',
'MIAGE V'))
lake_bbox <- st_bbox(miage) %>%
st_as_sfc() %>%
st_buffer(200) %>%
st_bbox()
miage_map <- tm_shape(miage) +
tm_polygons(fill = '#c6dbef', col = '#6baed6',
fill_alpha = 0.4, lwd = 1.5) +
tm_shape(miage_glacier, bbox = lake_bbox) +
tm_polygons(fill = 'white', col = '#08316B', lwd = 2) +
tm_shape(miage_2021) +
tm_polygons(fill = '#08306b', col = '#08306b', lwd = 0.5) +
tm_tiles(c(CartoDB = "CartoDB.PositronOnlyLabels")) +
tm_add_legend(type = 'polygons',
labels = c('1999', '2021'),
fill = c('#c6dbef', '#08306b'),
bg.color = '#876D4D',
text.color = 'white',
title.color = 'white',
frame.color = NA,
title = 'Year') +
tm_layout(bg.color = '#876D4D',
outer.bg.color = '#876D4D',
frame.color = NA,
frame.lwd = 0)
#------------ And lastly the plot of the Miage Area over time------------
# Add font
font_add_google(name = 'Fira Sans Condensed', # Fire sans for non-title
family = 'fira_sans_condensed')
# Grab years for x-axis
years <- lake_joined %>%
filter(grepl("Miage", lake)) %>%
pull(date_time) %>%
unique()
miage_area <- lake_joined %>%
filter(grepl("Miage", lake)) %>%
group_by(date_time) %>%
summarize(total_area = (sum(area_m_2, na.rm = TRUE))) %>%
ggplot(aes(x = date_time, y = total_area)) +
geom_line(color = '#68452E',
lwd = 3)+
geom_point(size = 4)+
scale_x_continuous(breaks = years)+
scale_y_continuous(labels = scales::comma)+
labs(
x = 'Year',
y = 'Area (Meters<sup>2</sup>)'
)+
theme_tufte()+
theme(
plot.background = element_rect(fill = '#048F7A'), # Cobalt
axis.title = ggtext::element_markdown(color = 'black',
family = 'fira_sans_condensed',
size = 20),
axis.title.y = ggtext::element_markdown(),
axis.text = element_text(color = 'black',
family = 'fira_sans_condensed',
size = 12),
plot.title = element_text(color = 'black',
family = 'quicksand'),
axis.line = element_line(color = "black", size = 1)
)
showtext.auto(enable = TRUE)
miage_area
ggsave(filename = 'AREA.pdf', width = 1500,
height = 1000, units = 'px')
showtext.auto(enable = FALSE)