% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/validate_mnirs.R
\name{within}
\alias{within}
\title{Detect if numeric values fall within range of a vector}
\usage{
within(x, vec, inclusive = c("left", "right"))
}
\arguments{
\item{x}{A numeric vector.}

\item{vec}{A numeric vector from which \code{left} and \code{right} boundary values
for \code{x} will be taken.}

\item{inclusive}{A character vector to specify which of \code{left} and/or
\code{right} boundary values should be included in the range, or both (the
default), or excluded if \code{FALSE}.}
}
\value{
A logical vector the same length as \code{x}.
}
\description{
Vectorised check for \code{x \%in\% vec}, inclusive or exclusive of left and right
boundary values, specified independently.
}
\details{
\code{inclusive = FALSE} can be used to test for positive non-zero values:
\code{within(x, c(0, Inf), inclusive = FALSE)}.
}
\seealso{
\code{\link[dplyr:between]{dplyr::between()}}
}
\keyword{internal}
