Skip to content

Commit

Permalink
Implement several fixes to plot_exp_n
Browse files Browse the repository at this point in the history
  • Loading branch information
BBeltz1 committed Jan 5, 2025
1 parent 4337da0 commit 3ad16a0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/plot_exp_n.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ plot_exp_n <- function(shadedRegion = NULL,

season <- stringr::str_to_upper(varName)

if (season == "fall"){
start_year = 1965
} else {
start_year = 1968
}

# optional code to wrangle ecodata object prior to plotting
# e.g., calculate mean, max or other needed values to join below
exp<- ecodata::exp_n |>
Expand Down Expand Up @@ -81,7 +87,7 @@ plot_exp_n <- function(shadedRegion = NULL,
ecodata::geom_gls() +
ecodata::geom_lm(n=n) +
#Axis and theme
ggplot2::scale_x_continuous(breaks = seq(1965, 2015, by = 10), expand = c(0.01, 0.01)) +
ggplot2::scale_x_continuous(breaks = seq(start_year, 2015, by = 10), expand = c(0.01, 0.01)) +
ggplot2::ylab("n species per 1000 ind") +
ggplot2::xlab(ggplot2::element_blank())+
ecodata::theme_facet()+
Expand Down

0 comments on commit 3ad16a0

Please sign in to comment.