# Loading in required packages
library(tidyverse)
library(cowplot)
library(ggridges)
library(janitor)
library(pander)
Load in and clean the dataset.
# loading in microclimate dataset
micro <- read_csv("data/microclimate_data_2025.csv")
# use janitor to make variable names pothole case
# helps to creat uniform styling across variable names
micro <- janitor::clean_names(micro)
# creating new df with only our two needed columns (disturbance, plant cover), and dropping all NA values and blank observations
# not strictly necessary to select columns but helps keep me sane working with a smaller df
micro_clean <- micro |>
select(disturbance, plant_cover) |> # keep only these two columns
filter(!is.na(disturbance), disturbance != "", # disturbance has blank obs
!is.na(plant_cover)) # ensured plant cover had no NAs
disturbance | Median Plant Cover (%) |
---|---|
High | 60 |
Intermediate | 92.5 |
Low | 75 |
ggplot(micro_clean, aes(disturbance, plant_cover))+
geom_violin()+ # used to create a violin plot
xlab("Disturbance Level")+ # x axis label
ylab("Plant Coverage (%)")+ # y axis label
stat_summary(fun=median, geom="point", size=2, color="red")+ # add red circle for
#median plant cover
geom_jitter(shape=16, alpha = 0.3, position=position_jitter(0.2))+ # adds each
#individual observation
theme_cowplot() # the best ggplot theme to make it look clean!