(ensure-time-column ds
time-col
{:keys [sorted? sort?] :or {sorted? false sort? true}})Common helper for ds-level time operations.
Given a dataset ds and a time-col keyword/name, this function:
time-col if needed.Options map:
time-col (ascending) before use.Returns a map {:ds ds' :time-col time-col :time-col-series col}, where
This fn does not change the column's representation (no millis conversion). Representation conversion should be done explicitly by callers when needed.
Common helper for ds-level time operations.
Given a dataset `ds` and a `time-col` keyword/name, this function:
1. Ensures the column exists in the dataset.
2. Optionally checks sortedness and sorts by `time-col` if needed.
Options map:
- :sorted? boolean, default false. If true, skip the sortedness check.
- :sort? boolean, default true. If true and the column is not sorted,
the dataset is sorted by `time-col` (ascending) before use.
Returns a map {:ds ds' :time-col time-col :time-col-series col}, where
- ds' is either the original ds or a sorted copy,
- time-col-series is the (possibly reordered) column from ds'.
This fn does *not* change the column's representation (no millis conversion).
Representation conversion should be done explicitly by callers when needed.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |