A simple wrapper to quickly estimate the periodicity of a given data.
Returning an object of type periodicity
.
This calculates the median time difference between observations as a
difftime object, the numerical difference, the units of measurement, and the
derived scale of the data as a string.
The time index currently must be of either a 'Date' or 'POSIXct' class, or
or coercible to one of them.
The 'scale' component of the result is an estimate of the periodicity of the
data in common terms - e.g. 7 day daily data is best described as 'weekly',
and would be returned as such.