% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predicates.R
\name{time_is_determinate_at}
\alias{time_is_determinate_at}
\title{Test whether time is determinate at a granule's precision}
\usage{
time_is_determinate_at(x, granule, ...)
}
\arguments{
\item{x}{A time object (typically a \code{mixtime} vector).}

\item{granule}{The time granule whose precision to test, given as a granule
generator (e.g. \code{cal_gregorian$month}) or a sized time unit (e.g.
\code{cal_gregorian$month(1L)}).}

\item{...}{Additional arguments for methods.}
}
\value{
A logical vector the same length as \code{x}.
}
\description{
\code{time_is_determinate_at()} tests, for each element of a \code{mixtime} vector, whether
the time point is well-defined at the precision of \code{granule}.
}
\details{
Discrete (integer) time cannot resolve a granule finer than its own chronon (a
\code{year()} has no determinate month), so those elements are \code{FALSE}. Continuous
(fractional) time tracks progress within its chronon and so resolves finer
granules exactly (0\% through 2020 is 0\% through January), giving \code{TRUE}.
Coarser-or-equal granules are always determinate. Missing (\code{NA}) and infinite
times give \code{NA}.
}
\examples{
# Discrete: a year has no determinate month
time_is_determinate_at(year(2020L), cal_gregorian$month(1L))

# Continuous: 0\% through 2020 is 0\% through January
time_is_determinate_at(year(2020), cal_gregorian$month(1L))

# A coarser granule is always determinate
time_is_determinate_at(yearmonth(as.Date("2020-02-01")), cal_gregorian$year(1L))

}
