% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/exclusion_check.R
\name{check_exclusions}
\alias{check_exclusions}
\title{Check exclusion criteria for all rows in a dataset}
\usage{
check_exclusions(df, tolerances)
}
\arguments{
\item{df}{A dataframe. Must contain at minimum a subset of the standard
column names (see \strong{Column Naming} below). Any exclusion factor for
which no column is present is silently skipped with a warning.}

\item{tolerances}{A species tolerance list as returned by
\code{\link[=get_species_tolerances]{get_species_tolerances()}}.}
}
\value{
The input dataframe with two additional columns:
\itemize{
\item \code{excluded}: logical -- \code{TRUE} if the location fails any exclusion criterion.
\item \code{exclusion_reason}: character -- semicolon-separated list of failed criteria,
or \code{NA} if not excluded.
}
}
\description{
Applies hard-stop exclusion criteria for a given species tolerance profile.
Any location that violates one or more exclusion rules receives a flag and
is removed from the suitability scoring pipeline.

Exclusion factors checked (where data columns are present):
\itemize{
\item General temperature range
\item Season-specific temperature floors/ceilings (requires \code{season} column)
\item Salinity (with temperature-dependent minimum)
\item Dissolved oxygen (hypoxia threshold)
}
}
\section{Column Naming}{

The function recognises these column names (case-insensitive):\tabular{ll}{
   Variable \tab Expected column name(s) \cr
   Temperature \tab \code{temperature}, \code{temp} \cr
   Salinity \tab \code{salinity}, \code{sal} \cr
   Dissolved oxygen \tab \code{dissolved_oxygen}, \code{do}, \code{do_mgl} \cr
   Season \tab \code{season} (auto-added by \code{\link[=add_season_column]{add_season_column()}}) \cr
}
}

\examples{
tol <- get_species_tolerances("ostrea_edulis")
df <- data.frame(
  lat = 51.5, lon = -2.5,
  temperature = 8, salinity = 28, dissolved_oxygen = 7
)
check_exclusions(df, tol)
}
