% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grd-subset.R
\name{grd_snap_next}
\alias{grd_snap_next}
\alias{grd_snap_previous}
\title{Index snap functions}
\usage{
grd_snap_next(x)

grd_snap_previous(x)
}
\arguments{
\item{x}{A vector of rescaled but non-integer indices}
}
\value{
A vector of integer indices
}
\description{
These functions can be used in \code{\link[=grd_cell]{grd_cell()}} and
\code{\link[=grd_cell_range]{grd_cell_range()}}. These functions differ in the way
they round 0.5: \code{\link[=grd_snap_next]{grd_snap_next()}} always rounds up
and \code{\link[=grd_snap_previous]{grd_snap_previous()}} always rounds down. You can
also use \code{\link[=floor]{floor()}} and \code{\link[=ceiling]{ceiling()}} as index
snap functions.
}
\examples{
grd_snap_next(seq(0, 2, 0.25))
grd_snap_previous(seq(0, 2, 0.25))

}
