| time_is_determinate_at | R Documentation |
time_is_determinate_at() tests, for each element of a mixtime vector, whether
the time point is well-defined at the precision of granule.
time_is_determinate_at(x, granule, ...)
x |
A time object (typically a |
granule |
The time granule whose precision to test, given as a granule
generator (e.g. |
... |
Additional arguments for methods. |
Discrete (integer) time cannot resolve a granule finer than its own chronon (a
year() has no determinate month), so those elements are FALSE. Continuous
(fractional) time tracks progress within its chronon and so resolves finer
granules exactly (0% through 2020 is 0% through January), giving TRUE.
Coarser-or-equal granules are always determinate. Missing (NA) and infinite
times give NA.
A logical vector the same length as x.
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.