Liking cljdoc? Tell your friends :D

tablecloth.api


->arrayclj

(->array ds colname)
(->array ds colname datatype)

Convert numerical column(s) to java array

Convert numerical column(s) to java array
sourceraw docstring

add-or-replace-columnclj

(add-or-replace-column ds column-name column)
(add-or-replace-column ds column-name column size-strategy)

Add or update (modify) column under column-name.

column can be sequence of values or generator function (which gets ds as input).

Add or update (modify) column under `column-name`.

`column` can be sequence of values or generator function (which gets `ds` as input).
sourceraw docstring

add-or-replace-columnsclj

(add-or-replace-columns ds columns-map)
(add-or-replace-columns ds columns-map size-strategy)

Add or updade (modify) columns defined in columns-map (mapping: name -> column)

Add or updade (modify) columns defined in `columns-map` (mapping: name -> column) 
sourceraw docstring

aggregateclj

(aggregate ds aggregator)
(aggregate ds
           aggregator
           {:keys [default-column-name-prefix ungroup?]
            :or {default-column-name-prefix "summary" ungroup? true}
            :as options})

Aggregate dataset by providing:

  • aggregation function
  • map with column names and functions
  • sequence of aggregation functions

Aggregation functions can return:

  • single value
  • seq of values
  • map of values with column names
Aggregate dataset by providing:

- aggregation function
- map with column names and functions
- sequence of aggregation functions

Aggregation functions can return:
- single value
- seq of values
- map of values with column names
sourceraw docstring

aggregate-columnsclj

(aggregate-columns ds columns-selector column-aggregators)
(aggregate-columns ds columns-selector column-aggregators options)

Aggregates each column separately

Aggregates each column separately
sourceraw docstring

anti-joinclj

(anti-join ds-left ds-right columns-selector)
(anti-join ds-left ds-right columns-selector options)
source

appendclj

(append ds & datasets)
source

as-regular-datasetclj

source

bindclj

(bind ds & datasets)
source

by-rankclj

(by-rank ds columns-selector rank-predicate)
(by-rank ds
         columns-selector
         rank-predicate
         {:keys [desc? ties] :or {desc? true ties :dense}})

Select rows using rank on a column, ties are resolved using :dense method.

See R docs. Rank uses 0 based indexing.

Possible :ties strategies: :average, :first, :last, :random, :min, :max, :dense. :dense is the same as in data.table::frank from R

:desc? set to true (default) order descending before calculating rank

Select rows using `rank` on a column, ties are resolved using `:dense` method.

See [R docs](https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/rank).
Rank uses 0 based indexing.

Possible `:ties` strategies: `:average`, `:first`, `:last`, `:random`, `:min`, `:max`, `:dense`.
`:dense` is the same as in `data.table::frank` from R

`:desc?` set to true (default) order descending before calculating rank
sourceraw docstring

cloneclj

(clone item)
(clone item datatype)

Create a new thing from the old thing and copy data into new thing.

Create a new thing from the old thing and copy data into new thing.
sourceraw docstring

columnclj

(column dataset column-name)

Return the column or throw if it doesn't exist.

Return the column or throw if it doesn't exist.
sourceraw docstring

column-countclj

(column-count dataset)
source

column-namesclj

(column-names ds)
(column-names ds columns-selector)
(column-names ds columns-selector meta-field)
source

columnsclj

(columns ds)
(columns ds result-type)
source

concatclj

(concat dataset & other-datasets)

Concatenate datasets. Respects missing values. Datasets must all have the same columns. Result column datatypes will be a widening cast of the datatypes.

Concatenate datasets.  Respects missing values.  Datasets must all have the same
columns.  Result column datatypes will be a widening cast of the datatypes.
sourceraw docstring

convert-typesclj

(convert-types ds coltype-map)
(convert-types ds columns-selector new-types)

Convert type of the column to the other type.

Convert type of the column to the other type.
sourceraw docstring

datasetclj

(dataset)
(dataset data)
(dataset data
         {:keys [single-value-column-name]
          :or {single-value-column-name :$value}
          :as options})

Create dataset.

Dataset can be created from:

  • single value
  • map of values and/or sequences
  • sequence of maps
  • sequence of columns
  • file or url
Create `dataset`.

Dataset can be created from:

* single value
* map of values and/or sequences
* sequence of maps
* sequence of columns
* file or url
sourceraw docstring

dataset->strclj

(dataset->str ds)
(dataset->str ds options)

Convert a dataset to a string. Prints a single line header and then calls dataset-data->str.

For options documentation see dataset-data->str.

Convert a dataset to a string.  Prints a single line header and then calls
dataset-data->str.

For options documentation see dataset-data->str.
sourceraw docstring

dataset-nameclj

(dataset-name dataset)
source

dataset?clj

(dataset? ds)

Is ds a dataset type?

Is `ds` a `dataset` type?
sourceraw docstring

differenceclj

(difference ds-left ds-right)
(difference ds-left ds-right options)
source

dropclj

source

drop-columnsclj

Drop columns by (returns dataset):

  • name
  • sequence of names
  • map of names with new names (rename)
  • function which filter names (via column metadata)
Drop columns by (returns dataset):

- name
- sequence of names
- map of names with new names (rename)
- function which filter names (via column metadata)
sourceraw docstring

drop-missingclj

Drop rows with missing values

columns-selector selects columns to look at missing values

Drop rows with missing values

`columns-selector` selects columns to look at missing values
sourceraw docstring

drop-rowsclj

Drop rows using:

  • row id
  • seq of row ids
  • seq of true/false
  • fn with predicate
Drop rows using:

- row id
- seq of row ids
- seq of true/false
- fn with predicate
sourceraw docstring

firstclj

(first ds)
source

fold-byclj

(fold-by ds columns-selector)
(fold-by ds columns-selector folding-function)
source

full-joinclj

(full-join ds-left ds-right columns-selector)
(full-join ds-left ds-right columns-selector options)
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

has-column?clj

(has-column? dataset column-name)
source

(head ds)
(head ds n)
source

infoclj

(info ds)
(info ds result-type)
source

inner-joinclj

(inner-join ds-left ds-right columns-selector)
(inner-join ds-left ds-right columns-selector options)
source

intersectclj

(intersect ds-left ds-right)
(intersect ds-left ds-right options)
source

join-columnsclj

(join-columns ds target-column columns-selector)
(join-columns ds
              target-column
              columns-selector
              {:keys [separator missing-subst drop-columns? result-type]
               :or {separator "-" drop-columns? true result-type :string}
               :as options})
source

lastclj

(last ds)
source

left-joinclj

(left-join ds-left ds-right columns-selector)
(left-join ds-left ds-right columns-selector options)
source

map-columnsclj

(map-columns ds column-name map-fn)
(map-columns ds column-name columns-selector map-fn)
source

order-byclj

(order-by ds columns-or-fn)
(order-by ds columns-or-fn comparators)
(order-by ds columns-or-fn comparators {:keys [select-keys]})

Order dataset by:

  • column name
  • columns (as sequence of names)
  • key-fn
  • sequence of columns / key-fn Additionally you can ask the order by:
  • :asc
  • :desc
  • custom comparator function
Order dataset by:
- column name
- columns (as sequence of names)
- key-fn
- sequence of columns / key-fn
Additionally you can ask the order by:
- :asc
- :desc
- custom comparator function
sourceraw docstring

pivot->longerclj

(pivot->longer ds)
(pivot->longer ds columns-selector)
(pivot->longer
  ds
  columns-selector
  {:keys [target-columns value-column-name splitter drop-missing? datatypes]
   :or {target-columns :$column value-column-name :$value drop-missing? true}})

tidyr pivot_longer api

`tidyr` pivot_longer api
sourceraw docstring

pivot->widerclj

(pivot->wider ds columns-selector value-columns)
(pivot->wider
  ds
  columns-selector
  value-columns
  {:keys [fold-fn concat-columns-with concat-value-with drop-missing?]
   :or {concat-columns-with "_" concat-value-with "-" drop-missing? true}})
source

(print-dataset ds)
(print-dataset ds options)
source

process-group-dataclj

(process-group-data ds f)
source

rand-nthclj

(rand-nth ds)
(rand-nth ds {:keys [seed]})
source

randomclj

(random ds)
(random ds n)
(random ds n {:keys [repeat? seed] :or {repeat? true}})
source

rename-columnsclj

(rename-columns ds columns-mapping)
(rename-columns ds columns-selector columns-map-fn)

Rename columns with provided old -> new name map

Rename columns with provided old -> new name map
sourceraw docstring

reorder-columnsclj

(reorder-columns ds columns-selector & columns-selectors)

Reorder columns using column selector(s). When column names are incomplete, the missing will be attached at the end.

Reorder columns using column selector(s). When column names are incomplete, the missing will be attached at the end.
sourceraw docstring

replace-missingclj

(replace-missing ds value)
(replace-missing ds columns-selector value)
(replace-missing ds columns-selector value strategy)
source

right-joinclj

(right-join ds-left ds-right columns-selector)
(right-join ds-left ds-right columns-selector options)
source

row-countclj

(row-count dataset)
source

rowsclj

(rows ds)
(rows ds result-type)
source

selectclj

source

select-columnsclj

Select columns by (returns dataset):

  • name
  • sequence of names
  • map of names with new names (rename)
  • function which filter names (via column metadata)
Select columns by (returns dataset):

- name
- sequence of names
- map of names with new names (rename)
- function which filter names (via column metadata)
sourceraw docstring

select-missingclj

Select rows with missing values

columns-selector selects columns to look at missing values

Select rows with missing values

`columns-selector` selects columns to look at missing values
sourceraw docstring

select-rowsclj

Select rows using:

  • row id
  • seq of row ids
  • seq of true/false
  • fn with predicate
Select rows using:

- row id
- seq of row ids
- seq of true/false
- fn with predicate
sourceraw docstring

semi-joinclj

(semi-join ds-left ds-right columns-selector)
(semi-join ds-left ds-right columns-selector options)
source

separate-columnclj

(separate-column ds column target-columns)
(separate-column ds column target-columns separator)
(separate-column ds
                 column
                 target-columns
                 separator
                 {:keys [missing-subst drop-column?]
                  :or {missing-subst "" drop-column? true}})
source

set-dataset-nameclj

(set-dataset-name dataset ds-name)
source

shapeclj

(shape ds)

Returns shape of the dataset [rows, cols]

Returns shape of the dataset [rows, cols]
sourceraw docstring

shuffleclj

(shuffle ds)
(shuffle ds {:keys [seed]})
source

tailclj

(tail ds)
(tail ds n)
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

unionclj

(union ds & datasets)
source

unique-byclj

(unique-by ds)
(unique-by ds columns-selector)
(unique-by ds
           columns-selector
           {:keys [strategy select-keys] :or {strategy :first} :as options})
source

unmark-groupclj

(unmark-group ds)

Remove grouping tag

Remove grouping tag
sourceraw docstring

unrollclj

(unroll ds columns-selector)
(unroll ds columns-selector options)
source

update-columnsclj

(update-columns ds columns-map)
(update-columns ds columns-selector update-functions)
source

write-csv!clj

(write-csv! ds output)
(write-csv! ds output options)

Write a dataset to a tsv or csv output stream. Closes output if a stream is passed in. File output format will be inferred if output is a string -

  • .csv, .tsv - switches between tsv, csv. Tsv is the default.
  • *.gz - write to a gzipped stream. At this time writing to json is not supported. options - :separator - in case output isn't a string, you can use either , or \tab to switch between csv or tsv output respectively.
Write a dataset to a tsv or csv output stream.  Closes output if a stream
is passed in.  File output format will be inferred if output is a string -
  - .csv, .tsv - switches between tsv, csv.  Tsv is the default.
  - *.gz - write to a gzipped stream.
At this time writing to json is not supported.
options -
:separator - in case output isn't a string, you can use either \, or \tab to switch
  between csv or tsv output respectively.
sourceraw docstring

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

× close