forked from IreneAndru/codrt_tor1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgsi.R
More file actions
39 lines (33 loc) · 1.29 KB
/
Copy pathgsi.R
File metadata and controls
39 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
`%>%` <- magrittr::`%>%`
dat <- ecodata::gsi %>%
dplyr::mutate(Year = Time %>%
stringr::str_trunc(4, "right", "") %>%
as.numeric(),
Month = Time %>%
stringr::str_trunc(2, "left", "") %>%
as.numeric(),
Month = ifelse(Month == 0.1, 10, Month))
dat
dat %>%
ggplot2::ggplot(ggplot2::aes(x = Month,
y = Value,
color = Year,
group = Year)) +
ggplot2::geom_line() +
ggplot2::geom_point() +
ggplot2::theme_bw() +
nmfspalette::scale_color_nmfs(palette = "regional web",
discrete = FALSE) +
ggplot2::ggtitle("Gulf Stream Anomaly by month") +
ggplot2::theme(legend.position = "bottom")
dat %>%
ggplot2::ggplot(ggplot2::aes(x = Year + (Month - 1)/12,
y = Value,
color = Month)) +
ggplot2::geom_line(color = "black") +
ggplot2::geom_point() +
ggplot2::theme_bw() +
nmfspalette::scale_color_nmfs(palette = "regional web",
discrete = FALSE) +
ggplot2::ggtitle("Gulf Stream Anomaly by year") +
ggplot2::theme(legend.position = "bottom")