# \donttest{
# Example dataset with one depth column
example_data <- data.frame(
sample_latitude_dd = c(59.3, 58.1, 57.5),
sample_longitude_dd = c(18.0, 17.5, 16.2),
sample_depth_m = c(10, -5, NA)
)
# Validate depths using OBIS XY lookup (bathymetry = NULL)
check_depth(example_data, depth_cols = "sample_depth_m")
# Example dataset with min/max depth columns
example_data2 <- data.frame(
sample_latitude_dd = c(59.0, 58.5),
sample_longitude_dd = c(18.0, 17.5),
sample_min_depth_m = c(5, 15),
sample_max_depth_m = c(3, 20)
)
check_depth(example_data2, depth_cols = c("sample_min_depth_m", "sample_max_depth_m"))
# Return only failing rows
check_depth(example_data, depth_cols = "sample_depth_m", report = FALSE)
# }
Run the code above in your browser using DataLab