-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEntero_March.R
57 lines (48 loc) · 1.79 KB
/
Entero_March.R
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#boxplot for ENTERO data showing MARCH 2022 highlighted sparks
## readin my data file
# ------------USE Readxlsx.R
## NOW need to select data set down to only what we want
entero_dat <- dat2 %>%
select(site,
date_sampled,
component_short,
result,
site,
site_friendly,
month,
day,
year) %>%
filter(component_short == 'ENTERO')
##plotting fxn for overlay of specific month of entero data
boxplot <- ggplot(data = entero_dat,
aes(x = site_friendly, y = result)) +
geom_boxplot(data = filter(entero_dat, year < "2022"),
aes(fill = "2017-2021")) +
geom_point(data = filter(entero_dat, month == 3 & year == 2022),
aes(color = "Mar 2022"),
size = 4) +
geom_point(data = filter(entero_dat, month == 4 & year == 2022),
aes(color = "Apr 2022"),
size = 4) +
scale_color_manual(name = "",
values = c("Mar 2022" = "red",
"Apr 2022" = "yellow")) +
scale_fill_manual(name = "",
values = c("2017-2021" = "white")) +
theme_classic() +
theme(legend.position = "bottom",
axis.text = element_text(color = "black")) +
scale_x_discrete(labels = c("Micklers",
"GL1",
"GL2",
"Lake\nMiddle",
"GL4",
"Lake\nSouth",
"River\nNorth",
"GR1",
"Guana\nRiver",
"GR3")) +
labs(x = '',
y = "Enterococuss MPN/100mL")
ggplotly(boxplot)
ggsave(plot = boxplot, filename = here("output", "EnteroSpikes.png"), dpi = 120)