% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/60-interval_index-indexing.R
\name{sub-.interval_index}
\alias{sub-.interval_index}
\alias{[.interval_index}
\alias{[[.interval_index}
\alias{[<-.interval_index}
\alias{[[<-.interval_index}
\alias{$.interval_index}
\alias{$<-.interval_index}
\title{Indexing for Interval Indexes}
\usage{
\method{[}{interval_index}(x, i, ...)

\method{[[}{interval_index}(x, i, ...)

\method{[}{interval_index}(x, i) <- value

\method{[[}{interval_index}(x, i) <- value

\method{$}{interval_index}(x, name)

\method{$}{interval_index}(x, name) <- value
}
\arguments{
\item{x}{An \code{interval_index}.}

\item{i}{Index input.}

\item{...}{Unused.}

\item{value}{Replacement value (unsupported).}

\item{name}{Element name (for \code{$} and \verb{$<-}).}
}
\value{
Read methods return interval payload values/subsets; replacement forms
always error.

For \code{$}: the matched payload element.

No return value; always errors because replacement indexing is unsupported.
}
\description{
Read indexing returns \code{interval_index} subsets while preserving interval/key
order; out-of-order selectors are canonicalized with a warning. Replacement
indexing is blocked.
}
\details{
Read indexing preserves canonical interval order in returned subsets.
\itemize{
\item Integer/character vectors are treated as selectors and canonicalized to
interval-order output.
\item Out-of-order selector vectors trigger a warning and are canonicalized.
\item Duplicate selectors are rejected.
\item \code{[[} and \code{$} return payload values.
\item Replacement indexing (\verb{[<-}, \verb{[[<-}, \verb{$<-}) is unsupported.
}
}
\examples{
ix <- interval_index(a = "A", b = "B", c = "C", start = c(1, 3, 5), end = c(2, 4, 6))

ix[c(3, 1)]         # warning; result returned in interval order
ix[c("c", "a")]     # warning; result returned in interval order
ix[c(TRUE, FALSE, TRUE)]
ix[["b"]]
ix$b

try(ix[c(2, 2)])
try(ix$b <- "updated")
}
