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? rename-index-to]
                   :or {ungroup? false}})

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:

  • rename-index-to - Rename the index column name
  • ungroup? - Set to true if you want the function to return a grouped dataset. Default: false
  • include-columns - Additional columns to include when adjusting when grouping at a new frequency.
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:
- rename-index-to   - Rename the index column name 
- ungroup?          - Set to true if you want the function to return a
                      grouped dataset. Default: false
- include-columns   - Additional columns to include when adjusting when
                      grouping at a new frequency.
sourceraw docstring

anytime->millisecondsclj

(anytime->milliseconds str-or-datetime)
(anytime->milliseconds str-or-datetime timezone)

Converts any time unit type to milliseconds.

Converts any time unit type to milliseconds.
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

dayofmonthclj

Extracts the day of the month from any datetime.

Extracts the day of the month from any datetime.
sourceraw docstring

dayofweekclj

Extract the day of week from any datetime.

Extract the day of week from any datetime.
sourceraw docstring

dayofyearclj

Extracts year (as number) from any datetime.

Extracts year (as number) from any datetime.
sourceraw docstring

down-to-nearestclj

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

hourclj

(hour datetime)

Extracts the hour from any datetime.

Extracts the hour from any datetime.
sourceraw docstring

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

milliseconds->anytimeclj

(milliseconds->anytime millis datetime-type)
(milliseconds->anytime millis datetime-type timezone)

Convert milliseconds to any time unit as specified by datetime-type.

Convert milliseconds to any time unit as specified by `datetime-type`.
sourceraw docstring

minuteclj

(minute datetime)

Extracts the minute of hour (number) from any datetime.

Extracts the minute of hour (number) from any datetime.
sourceraw docstring

monthclj

Extract month from any datetime.

Extract month from any datetime.
sourceraw docstring

rename-indexclj

(rename-index dataset new-index-name)

Renames the index column if it can be identified.

Renames the index column if it can be identified.
sourceraw docstring

rolling-windowclj

(rolling-window ds column-name len)

rolling-window dataset

rolling-window dataset
sourceraw docstring

secndclj

(secnd datetime)

Extracts the second of minute from any datetime.

Extracts the second of minute from any datetime.
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

yearclj

Extracts year (as number) from any datetime.

Extracts year (as number) from any datetime.
sourceraw docstring

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

× close