% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/components.R
\name{component_helpers}
\alias{component_helpers}
\alias{lin}
\alias{cyc}
\title{Linear and cyclical component helpers}
\usage{
lin(granule)

cyc(granule, cycle)
}
\arguments{
\item{granule}{The time granule to address, given as a granule generator (e.g.
\code{year}) or a sized time unit (e.g. \code{year(1L)}). Resolved in the calendar of
the time vector being formatted or decomposed.}

\item{cycle}{The coarser granule defining the cycle a \code{cyc()} component repeats
within (e.g. \code{year} in \code{cyc(month, year)}).}
}
\value{
A component specification, consumed internally by the component-aware
context (e.g. \code{\link[=format]{format()}} or \code{\link[=time_components]{time_components()}}).
}
\description{
\code{lin()} and \code{cyc()} name the time components addressed by mixtime's
\emph{component-aware contexts} — a single vocabulary shared across \code{\link[=format]{format()}} (and
parsing) format strings and \code{\link[=time_components]{time_components()}} expressions. They are only
meaningful inside one of these contexts; calling them directly is an error.
}
\details{
A linear and a cyclical component of the same granule store the \emph{same} value:
the count of that chronon since the Unix epoch. The reduction to a within-cycle
position happens only when a cyclical vector is formatted. \code{cyc()} therefore
behaves like \code{lin()} on its finest granule but additionally records the cycle.
}
\seealso{
\code{\link[=format]{format()}} and \code{\link[=time_components]{time_components()}}
}
