Liking cljdoc? Tell your friends :D

tablecloth.time.api


->daysclj

(->days datetime)
source

->everyclj

(->every interval chrono-unit)
(->every interval chrono-unit datetime)
source

->hoursclj

(->hours datetime)
source

->minutesclj

(->minutes datetime)
source

->months-endclj

(->months-end datetime)
source

->quarters-endclj

(->quarters-end datetime)
source

->secondsclj

(->seconds datetime)
source

->weeks-endclj

(->weeks-end datetime)
source

->years-endclj

(->years-end datetime)
source

adjust-intervalclj

(adjust-interval dataset
                 index-column-name
                 keys
                 ->new-time-converter
                 new-column-name)

Adjusts the interval of the dataset by adding a new column new-column-name whose values are the result of applying time-converter to the column specified by index-column-name, and then performing a group-by operation on that column and any columns specified by keys.

Adjusts the interval of the dataset by adding a new column `new-column-name`
whose values are the result of applying `time-converter` to the column specified
by `index-column-name`, and then performing a `group-by` operation on that column
and any columns specified by `keys`.
sourceraw docstring

down-to-nearestclj

(down-to-nearest interval chrono-unit)
(down-to-nearest interval chrono-unit datetime)
source

sliceclj

(slice dataset from to)
(slice dataset from to {:keys [result-type] :or {result-type :as-dataset}})

Returns a subset of dataset's rows (or row indexes) as specified by from and to, inclusively. from and to are either strings or datetime type literals (e.g. #time/local-date "1970-01-01"). The dataset must have been indexed, and the time unit of the index must match the unit of time by which you are attempting to slice.

Options are:

  • result-type - return results as dataset (:as-dataset, default) or a row of indexes (:as-indexes).

Example data:

:A:B
19700
19711
19722
19733

Example:

(-> data (index-by :A) (slice "1972" "1973"))

;; => _unnamed [2 2]:

:A:B
19722
19733
Returns a subset of dataset's rows (or row indexes) as specified by from and to, inclusively.
`from` and `to` are either strings or datetime type literals (e.g. #time/local-date "1970-01-01").
The dataset must have been indexed, and the time unit of the index must match the unit of time
by which you are attempting to slice.

Options are:

- result-type - return results as dataset (`:as-dataset`, default) or a row of indexes (`:as-indexes`).

Example data:

|   :A | :B |
|------|----|
| 1970 |  0 |
| 1971 |  1 |
| 1972 |  2 |
| 1973 |  3 |

Example:

(-> data
    (index-by :A)
    (slice "1972" "1973"))

;; => _unnamed [2 2]:

|   :A | :B |
|------|----|
| 1972 |  2 |
| 1973 |  3 |
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close