Variables and tables

The variables pane lists the objects in your session after every command. View() opens any table in a viewer that asks DuckDB for one page at a time, so a table with millions of rows opens at once.

The variables pane

The pane under the console updates after every command, yours or Claude's, and follows the console when you restart R or switch to Python. It lists your objects, including plots saved in variables (ggplot, lattice, patchwork).

The objects are sorted into five tabs: Data (data frames), Plots (plot objects), Values, Functions and Other. Move between them with ← →, Tab, the keys 1 to 5, or a click. / searches.

Enter on an object

ObjectWhat Enter does
A data frameOpens the table in the viewer, like View(). m opens it in Mirador instead.
A plot objectDraws it and opens it in Mirador. A plot that is already drawn opens without being drawn again.
Anything else, in RRuns str() on it in the console.
A function, in PythonShows its help in the console (name?).
Anything else, in PythonPrints it in the console.

The history of everything you drew isn't in this pane: it is in Mirador (ctrl+b f).

A bigger view

ctrl+b d (corral vars) opens the variables over the terminal, with the same keys; q closes it. If your layout has no variables pane, corral vars --split adds one under the R console.

Objects with more than a million elements don't show their size in memory, because computing it after every command would be slow. To stay fast, Corral describes a variable again only when the object changed (another address in memory, another length, other dimensions or, in tables, other column types).

Variables for agents

$ corral vars --json
$ corral vars --json --lang python

This prints the objects in the session (name, kind, class, dimensions or a preview, size) as JSON, without typing anything in the console. Without --lang it lists the console in view. Corral's skill tells Claude to use it before running code, so it doesn't guess names or overwrite your objects.

The table viewer

View(df) (in R or in Python), Enter on a data frame in the variables pane, or corral view on a file open the table over the terminal, in a viewer that queries the file with DuckDB.

The session saves the table as parquet, and the viewer asks DuckDB only for what is on screen: a page of rows, the row count, a sort or a search are each a query of a few milliseconds. A table of 10 million rows shows its first screen in about 34 ms, and the viewer itself uses about 3 MB.

$ corral view data/sales.parquet

corral view opens parquet, CSV and JSON files; --title sets the title. In Python, View() takes pandas, polars or pyarrow tables. In R, it writes parquet with nanoparquet or arrow; without either, it uses CSV.

Keys

KeyAction
↑ ↓, PgUp PgDn, g GMove through the rows (the mouse wheel too)
← →, 0 $Move through the columns; with the mouse, the horizontal wheel, a sideways swipe on the trackpad, or Shift and the wheel
s (or a click on the header)Sort by the column: ascending, descending, unsorted
/Search a text in every column; / and an empty Enter clear the search
fFilter with a condition; it starts with the name of the current column
=Keep only the rows with the value of the selected cell
xRemove every filter and the search
EnterSee the whole row
iSummary of each column (DuckDB's SUMMARIZE)
mOpen the table in Mirador, in your browser; the viewer stays open
qClose

Filters

A filter takes R or DuckDB's SQL:

mpg > 20 & cyl == 6
region %in% c("a", "b")
!is.na(x)
region LIKE 'nor%'

Filters add up, with each other and with the search, and the top line says which ones are active and how many rows are left. If a filter has an error, it isn't applied, and DuckDB says why.

Tables in Mirador

The terminal is the default, and Mirador opens a table only when you ask, for example when you want more room for a wide one. Any of these does it:

Mirador opens the same file in a tab of its own, and the table works as in the terminal, with the same DuckDB queries and the same keys: / searches, f adds a filter in R or SQL, = keeps the rows equal to the selected cell, s sorts (a click on a header too), x clears, Enter shows the whole row and i the summary. Each filter shows as a label you can remove with its ×, and the top line says how many rows are left. Every tab keeps its filters, sort and position while you look at another one.

127.0.0.1 · Mirador · sales
A 10,000,000-row sales table in Mirador, filtered to 666,741 rows with units > 10 and two regions, sorted by revenue

Outside herdr, View() opens tables in Mirador when Mirador is running; CORRAL_VIEW changes that (see Configuration).

Tables from View() are saved in R's (or Python's) temporary folder, and they go away when you close the console.

VisiData instead

If you prefer VisiData and have it installed (vd), tables open there, with Corral's colors:

$ corral config table_viewer visidata

Any other value, such as corral, goes back to Corral's viewer. To use a viewer of your own, set CORRAL_TABLE_VIEWER to its command; {file} is replaced by the table's path.