Code
library(tidyverse)
library(here)
library(readxl)
library(lubridate)
library(cowplot)
Olivia Hemond
January 30, 2024
This project investigates abundance data collected on the mountain yellow-legged frog (Rana muscosa) from 1995 - 2002 in water bodies in the southern Sierra Nevada.
Data was obtained from:
Knapp, R.A., C. Pavelka, E.E. Hegeman, and T.C. Smith. 2020. The Sierra Lakes Inventory Project: Non-Native fish and community composition of lakes and ponds in the Sierra Nevada, California ver 2. Environmental Data Initiative. https://doi.org/10.6073/pasta/d835832d7fd00d9e4466e44eea87fab3
I found counts for each life stage (adult, subadult, and tadpole) for Rana muscosa within each year across the entire study region. For this analysis, I excluded any observations of the egg-mass life stage.
ramu_df <- amphib_df %>%
mutate(date = lubridate::ymd(survey_date)) %>% # Convert survey date column to date format
mutate(year = lubridate::year(date)) %>% # Extract year from the date column
filter(amphibian_species == 'RAMU' &
amphibian_life_stage != 'EggMass') %>% # Filter for just Rana muscosa and exclude egg-mass observations
group_by(year, amphibian_life_stage) %>%
summarize(ramu_count = sum(amphibian_number)) %>% # Add together the number of observed frogs in each year and life stage
ungroup()
I built a plot that shows Rana muscosa counts by life stage across each year of the study period.
ramu_plot <- ggplot(data = ramu_df, aes(x = year, y = ramu_count, fill = amphibian_life_stage)) +
geom_col(position = 'stack') +
labs(x = 'Year', y = 'Count', fill = 'Life Stage') +
ggtitle(expression(paste('Annual counts of ', italic('Rana muscosa'), ' by life stage'))) +
scale_fill_manual(values = c('darkslategray4', 'darkslategray2', 'darkseagreen3')) +
scale_x_continuous(n.breaks = 8) +
scale_y_continuous(labels = scales::comma_format()) +
theme_classic() +
theme(legend.position = c(0.11, 0.85))
I found the five lakes in the study area with the greatest total number of Rana muscosa observed. I counted the total number of frogs observed across the entire study period, without differentiating by year. I then calculated and graphed the counts of (combined) adult and subadult frogs in these five lakes.
ramu_lakes_df <- amphib_df %>%
filter(amphibian_species == 'RAMU' &
amphibian_life_stage %in% c('Adult', 'SubAdult')) %>% # Filter for just Rana muscosa and just adult/subadults
group_by(lake_id) %>%
summarize(count = sum(amphibian_number)) %>% # Add together the number of observed frogs
ungroup() %>%
slice_max(count, n = 5) %>% # Take the 5 lakes with the largest counts
mutate(lake_id = as.factor(lake_id))
I built a second plot, this time to show the counts of Rana muscosa in each of the five lakes where it was most numerous. Lake IDs are used instead of specific lake names, in order to keep these locations confidential.
ramu_lakes_plot <- ggplot(data = ramu_lakes_df, aes(y = fct_reorder(lake_id, count, .desc = FALSE), x = count)) +
geom_col(fill = 'darkslategray3') +
labs(x = 'Count (Adults & Subadults)', y = 'Lake ID') +
ggtitle(expression(paste('Five lakes with highest counts of ', italic('Rana muscosa')))) +
scale_x_continuous(labels = scales::comma_format()) +
theme_classic()
I combined the two plots I built above into one figure. As seen in panel A, the majority of Rana muscosa observed in most of the study years were in tadpole form. There is also a high degree of variability in counts from year to year. As shown in panel B, the maximum total number of these frogs observed in any one lake over this time period was about 2,500.