From ed8decc59a808de0fd1a40611e145b0defab9541 Mon Sep 17 00:00:00 2001 From: Glenda Yenni Date: Fri, 3 May 2024 13:39:31 -0600 Subject: [PATCH] Correct initiation target --- R/indicator_analysis.R | 12 ++++++------ R/report_work.R | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/R/indicator_analysis.R b/R/indicator_analysis.R index 95bcf8b..22f9ceb 100644 --- a/R/indicator_analysis.R +++ b/R/indicator_analysis.R @@ -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(), @@ -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(), @@ -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(), @@ -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(), diff --git a/R/report_work.R b/R/report_work.R index e84b682..4da64ca 100644 --- a/R/report_work.R +++ b/R/report_work.R @@ -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) +