ts/man/ts_integer.Rd
2025-02-24 14:35:02 +13:00

28 lines
715 B
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/types.R
\name{ts_integer}
\alias{ts_integer}
\title{Integer type}
\usage{
ts_integer(n = -1L)
}
\arguments{
\item{n}{The length of the integer vector. If \code{n = 1} then a single integer is expected. If \code{n = 0} then any length is expected. If \code{n > 1} then an integer vector of length \code{n} is expected.}
}
\value{
A ts object that accepts integer scalars or vectors of length \code{n}.
}
\description{
Integers are represented in Zod schema as either a number (\code{z.number()}),
or a Int32Array (\code{z.instanceof(Int32Array)}).
}
\examples{
x <- ts_integer(1)
x$check(1L)
\dontrun{
# this will fail
x$check(1:10)
}
}