is_complete {CFtime}R Documentation

Indicates if the time series is complete

Description

This function indicates if the time series is complete, meaning that the time steps are equally spaced and there are thus no gaps in the time series.

Usage

is_complete(x)

Arguments

x

An instance of the CFtime class

Details

This function gives exact results for time series where the nominal unit of separation between observations in the time series is exact in terms of the datum unit. As an example, for a datum unit of "days" where the observations are spaced a fixed number of days apart the result is exact, but if the same datum unit is used for data that is on a monthly basis, the assessment is approximate because the number of days per month is variable and dependent on the calendar (the exception being the ⁠360_day⁠ calendar, where the assessment is exact). The result is still correct in most cases (including all CF-compliant data sets that the developers have seen) although there may be esoteric constructions of CFtime and offsets that trip up this implementation.

Value

logical. TRUE if the time series is complete, with no gaps; FALSE otherwise. If no offsets have been added to the CFtime instance, NA is returned.

Examples

cf <- CFtime("days since 1850-01-01", "julian", 0:364)
is_complete(cf)

[Package CFtime version 1.4.0 Index]