Skip to content

Commit

Permalink
Correct initiation target
Browse files Browse the repository at this point in the history
  • Loading branch information
gmyenni committed May 3, 2024
1 parent f3f45a3 commit ed8decc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions R/indicator_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ foraging_analysis <- function(path = get_default_data_path(),
geom_ysidedensity(aes(fill=period), alpha = .5) +
geom_ysidehline(yintercept = 32, linetype=2, color="darkgreen", linewidth=1) +
theme(
text = element_text(family = "AppleGothic", size = 15),
text = element_text(family = "AppleGothic", size = 18),
ggside.panel.border = element_blank(),
ggside.panel.grid = element_blank(),
ggside.panel.background = element_blank(),
Expand Down Expand Up @@ -85,16 +85,16 @@ initiation <- initiation_indicator(minyear = 2004) %>%
geom_line(color="black", linewidth=1.1) +
geom_ribbon(alpha=0.2, fill="grey") +
geom_ribbon(alpha=0.5, aes(color=NULL, fill=period)) +
geom_hline(yintercept=2.5, linetype=2, color="darkgreen", linewidth=1) +
geom_hline(yintercept=4.5, linetype=2, color="darkgreen", linewidth=1) +
scale_y_reverse(limits=c(5,-.2), breaks=c(4,3,2,1,0),labels=c("December","January","February","March","April")) +
labs(x="Year", y = "Date Score") +
theme_classic() +
theme(legend.position="none") +
guides(fill = guide_legend(byrow = TRUE)) +
geom_ysidedensity(aes(fill=period), alpha = .5) +
geom_ysidehline(yintercept = 2.5, linetype=2, color="darkgreen", linewidth=1) +
geom_ysidehline(yintercept = 4.5, linetype=2, color="darkgreen", linewidth=1) +
theme(
text = element_text(family = "AppleGothic", size = 15),
text = element_text(family = "AppleGothic", size = 18),
ggside.panel.border = element_blank(),
ggside.panel.grid = element_blank(),
ggside.panel.background = element_blank(),
Expand Down Expand Up @@ -147,7 +147,7 @@ library(ggside)
geom_ysidedensity(aes(fill=period), alpha = .5) +
geom_ysidehline(yintercept = .5, linetype=2, color="darkgreen", linewidth=1) +
theme(
text = element_text(family = "AppleGothic", size = 15),
text = element_text(family = "AppleGothic", size = 18),
ggside.panel.border = element_blank(),
ggside.panel.grid = element_blank(),
ggside.panel.background = element_blank(),
Expand Down Expand Up @@ -200,7 +200,7 @@ library(ggside)
geom_ysidedensity(aes(fill=period), alpha = .5) +
geom_ysidehline(yintercept = 1.6, linetype=2, color="darkgreen", linewidth=1) +
theme(
text = element_text(family = "AppleGothic", size = 15),
text = element_text(family = "AppleGothic", size = 18),
ggside.panel.border = element_blank(),
ggside.panel.grid = element_blank(),
ggside.panel.background = element_blank(),
Expand Down
5 changes: 3 additions & 2 deletions R/report_work.R
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ plot_initiation <- function(path = get_default_data_path(),
dplyr::arrange(.data$year) %>%
dplyr::filter(dplyr::between(.data$year, minyear, maxyear)) %>%
dplyr::mutate(color = dplyr::case_when(.data$date_score<1.5 ~ "red4",
dplyr::between(.data$date_score,1.5,2.5) ~ "orange",
.data$date_score>2.5 ~ "darkgreen")) %>%
dplyr::between(.data$date_score,1.5,4.5) ~ "orange",
.data$date_score>4.5 ~ "darkgreen")) %>%

ggplot2::ggplot(ggplot2::aes(.data$year, .data$date_score, color=.data$color)) +
ggplot2::geom_hline(yintercept=4.5, linetype=2, color="darkgreen", linewidth=.5) +
ggplot2::geom_hline(yintercept=2.5, linetype=2, color="orange", linewidth=.5) +
ggplot2::geom_hline(yintercept=1.5, linetype=2, color="red4", linewidth=.5) +
ggplot2::geom_point(alpha=2, size=3, shape=15) +
Expand Down

0 comments on commit ed8decc

Please sign in to comment.