Liking cljdoc? Tell your friends :D

tablecloth.api.group-by


as-regular-datasetclj

source

group-byclj

(group-by ds grouping-selector)
(group-by
  ds
  grouping-selector
  {:keys [select-keys result-type] :or {result-type :as-dataset} :as options})

Group dataset by:

  • column name
  • list of columns
  • map of keys and row indexes
  • function getting map of values

Options are:

  • select-keys - when grouping is done by function, you can limit fields to a select-keys seq.
  • result-type - return results as dataset (:as-dataset, default) or as map of datasets (:as-map) or as map of row indexes (:as-indexes) or as sequence of (sub)datasets
  • other parameters which are passed to dataset fn

When dataset is returned, meta contains :grouped? set to true. Columns in dataset:

  • name - group name
  • group-id - id of the group (int)
  • data - group as dataset
Group dataset by:

- column name
- list of columns
- map of keys and row indexes
- function getting map of values

Options are:

- select-keys - when grouping is done by function, you can limit fields to a `select-keys` seq.
- result-type - return results as dataset (`:as-dataset`, default) or as map of datasets (`:as-map`) or as map of row indexes (`:as-indexes`) or as sequence of (sub)datasets
- other parameters which are passed to `dataset` fn

When dataset is returned, meta contains `:grouped?` set to true. Columns in dataset:

- name - group name
- group-id - id of the group (int)
- data - group as dataset
sourceraw docstring

grouped?clj

(grouped? ds)

Is dataset represents grouped dataset (result of group-by)?

Is `dataset` represents grouped dataset (result of `group-by`)?
sourceraw docstring

groups->mapclj

(groups->map ds)

Convert grouped dataset to the map of groups

Convert grouped dataset to the map of groups
sourceraw docstring

groups->seqclj

(groups->seq ds)
source

process-group-dataclj

(process-group-data ds f)
source

ungroupclj

(ungroup ds)
(ungroup ds
         {:keys [order? add-group-as-column add-group-id-as-column separate?
                 dataset-name]
          :or {separate? true}})

Concat groups into dataset.

When add-group-as-column or add-group-id-as-column is set to true or name(s), columns with group name(s) or group id is added to the result.

Before joining the groups groups can be sorted by group name.

Concat groups into dataset.

When `add-group-as-column` or `add-group-id-as-column` is set to `true` or name(s), columns with group name(s) or group id is added to the result.

Before joining the groups groups can be sorted by group name.
sourceraw docstring

unmark-groupclj

(unmark-group ds)

Remove grouping tag

Remove grouping tag
sourceraw docstring

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

× close