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-frequencyclj

(adjust-frequency dataset converter)
(adjust-frequency dataset
                  converter
                  {:keys [include-columns ungroup?] :or {ungroup? true}})

Adjusts the frequency of the time index column by applying the converter function to the values in the time index. Returns a grouped dataset that can be used with tablecloth.api.aggregate, for example.

Options are:

  • ungroup? - Set to true if you want the function to return a grouped dataset. Default: true
Adjusts the frequency of the time index column by applying the
`converter` function to the values in the time index. Returns a
grouped dataset that can be used with `tablecloth.api.aggregate`,
for example.


Options are:

- ungroup? - Set to true if you want the function to return a
             grouped dataset. Default: true
sourceraw docstring

convert-toclj

(convert-to datetime datetime-type)

Convert time to different type as specified by datetime-type.

Convert time to different type as specified by `datetime-type`.
sourceraw docstring

down-to-nearestclj

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

index-byclj

(index-by dataset index-column-name)

Identifies the column that should be used as the index for the dataset. Useful when functions that use the index to perform their operations, cannot auto-detect the index column. This can happen if there are more than one time-based column; or, if it is not clear that any column contains time data.

Identifies the column that should be used as the index for the
dataset. Useful when functions that use the index to perform their
operations, cannot auto-detect the index column. This can happen if
there are more than one time-based column; or, if it is not clear
that any column contains time data.
sourceraw docstring

rolling-windowclj

(rolling-window ds column-name len)

rolling-window dataset

rolling-window dataset
sourceraw docstring

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

string->timeclj

(string->time str)

Given an identifiable time, returns the correct datetime object. Optionally, you can specify a target type to also convert to a different type in one step.

TODO: How do we define what an 'identifiable' string means?

Given an identifiable time, returns the correct datetime object.
Optionally, you can specify a target type to also convert to a
different type in one step.

TODO: How do we define what an 'identifiable' string means?
sourceraw docstring

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

× close