Attach packages

# Mono Lake Annual Levels
# Data provided by Mono Basin Clearinghouse
# Data collected from 1850 - present
# Data collected yearly on October 1st in feet above mean sea level
# -------------------------

# Attach packages
library(tidyverse)
library(tidyr)
library(here)
library(ggridges)
library(janitor)
library(purrr)

Read in data & tidy

# Read in data

mono_lake_annual_levels <- read_csv("Mono Lake Annual Levels.csv") 

# Tidy data, rename column variables, and use {purrr} to change observations to numeric instead of character

lake_levels_tidy <- mono_lake_annual_levels %>%
  clean_names() %>%
  rename(year = mono_lake_level_1850_present, lake_level = x2, stable_level = x3, volume = x4, surface_area = x5, vertical_change = x6) %>%
  slice(-1:-5) %>%
  purrr::modify_if(is.character, as.numeric)

Create a graph of Mono Lake levels

# Create your graph using ggplot()
# -------------------------

mono_lake_graph <- ggplot(data = lake_levels_tidy, aes(x = year, y = lake_level)) +
  geom_line(color = "blue", 
            size = 0.5) +
  scale_x_continuous(limits = c(1850, 2020), 
                     expand = c(0,0),
                     breaks = seq(1850, 2020, by=25)) +
  scale_y_continuous(limits = c(6372,6428), 
                     expand = c(0,0),
                     breaks = seq(6370,6430, by=10)) +
  theme_bw() +
  labs(x = "Year", y = "Mono Lake level (ft above sea level)") +
  ggtitle("Annual Mono Lake Levels: 1850 - 2017") +
  theme(plot.title = element_text(hjust = 0.5)) + 
  geom_hline(yintercept = 6377, 
             linetype = "solid", 
             color = "red",
             size = 0.5) +
  geom_text(x = 1852, y = 6375, label = "Land Bridges Emerge - 6,377 ft",
            color = "red",
            size = 3,
            hjust = 0,
            vjust = 0.5) +
  geom_point(aes(x = 1941, y = 6417),
             color = "black",
             size = 1) + 
  annotate("text", label = "1941 - LA DWP Tributary Diversion",
           x = 1950,
           y = 6418,
           size = 3,
           color = "black",
           vjust = 0,
           hjust = 0.10) +
  geom_point(aes(x = 1978, y = 6375),
             color = "black",
             size = 1) +
  annotate("text", label = "1978 - Mono Lake Committee Formed",
           x = 1968,
           y = 6375,
           size = 3,
           color = "black",
           vjust = 0.15,
           hjust = 0.85) +
  geom_point(aes(x = 1998, y = 6384.40),
             color = "black",
             size = 1) +
  annotate("text", label = "1998 - State Water Board \n Issued Restoration",
           x = 1995,
           y = 6387,
           size = 3,
           color = "black",
           vjust = 0.2,
           hjust = 0.55) +
  geom_hline(yintercept = 6392,
             linetype = "solid",
             color = "dark green",
             size = 0.5) +
  geom_text(x = 1852, y = 6394,
            label = "Future Stabilization Level - 6,392 ft",
            color = "dark green",
            size = 3,
            hjust = 0,
            vjust = 0)

mono_lake_graph

#ggsave(here::here("figures", "mono_lake_graph.png"))