define_day_indices: Generate sequential day indices from ISO 8601 timestamps
Description
Converts a vector of ISO 8601 timestamps into sequential day indices
(1, 2, 3, ...), where each unique calendar date corresponds to a unique
integer. This is useful for looping over or summarizing data by day
when working with minute-level time series from wearables.
Usage
define_day_indices(ts)
Value
An integer vector of the same length as `ts`, where each element
gives the index of the day the timestamp belongs to. The first unique
date encountered is assigned index `1`, the second `2`, and so on.
Arguments
ts
Character vector of ISO 8601 timestamps
(e.g., `"2024-06-26T23:45:00+0100"`). Time zone offsets are handled
correctly when converting to `Date`.