# Minimal example dataset
example_data <- dplyr::tibble(
station_name = c("S1", "S2"),
sample_date = as.Date(c("2025-01-01", "2025-01-02")),
sample_id = 1:2,
shark_sample_id_md5 = letters[1:2],
sample_min_depth_m = c(0, 5),
sample_max_depth_m = c(1, 6),
parameter = c("Param1", "Param1"),
value = c(5, 12),
delivery_datatype = c("TypeA", "TypeA")
)
example_thresholds <- dplyr::tibble(
parameter = "Param1",
datatype = "TypeA",
extreme_upper = 10,
mild_upper = 8
)
# Check for values above "extreme_upper"
check_outliers(
data = example_data,
parameter = "Param1",
datatype = "TypeA",
threshold_col = "extreme_upper",
thresholds = example_thresholds,
return_df = TRUE
)
# Check for values above "mild_upper"
check_outliers(
data = example_data,
parameter = "Param1",
datatype = "TypeA",
threshold_col = "mild_upper",
thresholds = example_thresholds,
return_df = TRUE
)
Run the code above in your browser using DataLab