What goes in a column

So far a new column has been arithmetic on the ones already there. This part is about everything else you can put in one. Text you need to clean up, a number that arrived as text, a date you want the year out of, a category that depends on a condition. Missing values are their own subject, and they get the closing chapter.

The cell is where grammars usually leak. Most tools keep their verbs small and then hand the inside of a column to something larger. A regular expression language for text, a format string for dates, the host language itself for everything conditional. Each of those is a second grammar hiding inside the first, and each is a thing you relearn every time you return.

So one law holds this part together: no new grammar inside a cell. Every value in this part is written the same way, as a plain named function inside add or summarize, taking columns and giving a column. The words are few and closed on purpose: a handful of text repairs, three conversions that say what they give, five date parts, a conditional and a lookup. When they are not enough, the answer is the exit shown in What it wrote, not a pattern language brought in through a cell.

The order of the chapters is the order the problems arrive in. Text first, because most tables arrive untidy. Then conversions, because a cleaned column is often still the wrong kind. Then dates, the conversion with its own vocabulary, and then the conditional. Missing values come last, because missingness touches everything before it.