daily_average_do <- function(x) {
final.df <- do.df %>%
filter(wqs.type %in% "average",
wqs.time %in% "daily") %>%
group_by(SEG_ID, date, clean_class, CHEMICAL_NAME, wqs.narrative,
wqs.type,
wqs.violation.direction, wqs.numeric, units) %>%
summarize(daily_average = mean(RESULT_NUMERIC, na.rm = TRUE)) %>%
ungroup() %>%
mutate(impaired = less_than_greater_than(x = .,
direction_col = wqs.violation.direction,
standard_col = wqs.numeric,
value_col = daily_average))
}
impairment_do <- function(x, value_col) {
do.df <- x %>%
filter(CHEMICAL_NAME %in% "Dissolved Oxygen")
min_thresh.df <- do.df %>%
filter(wqs.type %in% "threshold",
wqs.time %in% "single") %>%
select(SEG_ID, date, clean_class, CHEMICAL_NAME, wqs.narrative,
wqs.type,
wqs.violation.direction, wqs.numeric, units, RESULT_NUMERIC) %>%
mutate(impaired = less_than_greater_than(x = .,
direction_col = wqs.violation.direction,
standard_col = wqs.numeric,
value_col = RESULT_NUMERIC)) %>%
select(-RESULT_NUMERIC)
bound.df <- dplyr::bind_rows(daily_avg.df, min_thresh.df) %>%
group_by(SEG_ID, date, clean_class, CHEMICAL_NAME, wqs.narrative,
wqs.violation.direction, units) %>%
summarize(impaired = any(impaired == TRUE))
}
mean_agg <- function(x, wqs_type, wqs_time) {
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.