Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Quick start

Open public penguin measurements from the built-in catalog, compare three species, chart them, and copy the result. Install datui first.

1. Open the data

datui

Type penguins to narrow the home screen, select Palmer penguins under Example datasets, and press Enter. A catalog file this small downloads without a question.

The home screen narrowed to penguins: Palmer penguins under Example datasets, its details beside it: a 16.1 KB CSV over HTTP, CC0, no login

Type penguins: one match, its details beside it. Enter opens it.

The table has 344 penguins. Empty fields in the file are null, shown as ∅; rownames is the row number the host, Rdatasets, adds. The data is CC0, from Palmer Station LTER; credit Horst, Hill and Gorman (2020).

To skip the home screen, give the URL; datui asks before it downloads a URL you type, and Enter says yes:

datui https://vincentarelbundock.github.io/Rdatasets/csv/palmerpenguins/penguins.csv
KeyAction
Arrow keys or h j k lMove around
PgUp PgDnMove a page
Wheel, clickScroll; put the cursor on a cell. A double-click inspects the row
iInfo panel: columns and file details
?This screen’s keys; Enter on one runs it
EscClose a panel or go back
qBack to the home screen; quits when the table was opened from the shell
Ctrl+QQuit

2. Group by species

Which species is heaviest? Press :; the command line opens at sql:. Type this, then press Enter:

SELECT species, AVG(body_mass_g) AS mean_mass_g, COUNT(*) AS penguins
FROM df
GROUP BY species
ORDER BY mean_mass_g DESC

Type it on one line, or press Alt+Enter for a new line.

speciesmean_mass_gpenguins
Gentoo5076.01626124
Chinstrap3733.08823568
Adelie3700.662252152

The species summary in the table: Gentoo heaviest at 5,076 g over 124 penguins, then Chinstrap and Adelie

Which species is heaviest? Gentoo, 5,076 g on average over 124 penguins. :, the query, Enter.

AVG skips the two penguins with no mass; COUNT(*) counts every row. The table is named df. Press Enter on Gentoo to see its 124 penguins, and Esc to come back.

The same summary is one line in q, a subset of q that evaluates right to left. Press :, then Ctrl+T for q::

select mean_mass_g: avg body_mass_g by species

A new query starts a fresh view, clearing sidebar filters and sort. See querying for more SQL and q.

3. Chart the measurements

Do heavier penguins have longer flippers? Press R to return to the original rows, put the column cursor on body_mass_g (g, type body_mass_g, Enter), then press c for a chart and 2 for Scatter. Y starts on the cursor’s column.

ShelfChoose
TypeScatter (2)
Xflipper_length_mm
Ybody_mass_g

A scatter of body_mass_g against flipper_length_mm: heavier penguins have longer flippers

Do heavier penguins have longer flippers? Yes. c 2, then X flipper_length_mm.

↓ ↑ move between rows of the panel; Space on X opens its picker. Type part of the name and press Enter. The two penguins with no measurements are left out.

Now press 3 for Bar, choose species for X, and on Aggregate press → for count: Adelie 152, Gentoo 124, Chinstrap 68.

Press e in the chart to export a PNG, SVG or PDF. Press Esc to return to the table. More chart options.

4. Copy or export

Run the species summary again, then choose an output:

Do thisHow
Copy the summary into a notey → Scope Table → Format Markdown → Enter
Export a data filee → type penguin-summary.csv in Path → Enter
Reuse the query on another filev → s to save a view

Export and copy use the current rows and columns. They do not overwrite the input file unless you export to that path and confirm.

Use your own data

Replace <FILE>, <DIRECTORY> and <BUCKET>/<PREFIX> with your own:

datui <FILE>
datui <DIRECTORY>/
datui s3://<BUCKET>/<PREFIX>/

datui alone starts at the home screen.

Next: open files and directories, formats, cloud access, or all keyboard shortcuts.