moco-water/workflow/scripts/summarize_ucmr.R

33 lines
847 B
R

library(tidyverse)
df <- readr::read_tsv(
snakemake@input[[1]],
col_types = cols(date = "D", value = "d", .default = "c")
) %>%
filter(PWSID == snakemake@config[["my_pswid"]]) %>%
select(-PWSID, -PWSName)
# purification plant sample point
df %>%
filter(sample_point_ID == snakemake@config[["my_plant_id"]]) %>%
filter(sample_point_type == "EP") %>%
ggplot(aes(value, fct_rev(species))) +
geom_jitter() +
scale_x_log10() +
labs(x = "level (ug/ml)",
y = "species",
title = "Purification Plant")
ggsave(snakemake@output[["plant"]])
# tap sample points
df %>%
filter(sample_point_type %in% c("DS", "MR")) %>%
ggplot(aes(value, fct_rev(species))) +
geom_jitter() +
scale_x_log10() +
labs(x = "level (ug/ml)",
y = "species",
title = "Purification Plant")
ggsave(snakemake@output[["tap"]])