% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/30-api-flexseq-ends.R
\name{peek_at}
\alias{peek_at}
\title{Peek at an Element by Position}
\usage{
peek_at(x, index)
}
\arguments{
\item{x}{A \code{flexseq}.}

\item{index}{One-based position to read.}
}
\value{
Element at \code{index}, or \code{NULL} when \code{index} is out of bounds.
}
\description{
Returns the element at a one-based index without modifying the sequence.
}
\details{
Positive integer indices beyond \code{length(x)} return \code{NULL}.
Invalid indices (\code{NA}, non-integer, \verb{<= 0}, or length not equal to 1) error.
}
\examples{
x <- flexseq("a", "b", "c")
peek_at(x, 2)
peek_at(x, 10)

try(peek_at(x, 0))
}
