Reshape: wide to long
The most common transform. Many datasets are wide — one column per series:transform.reshape pivots wide to long so you can map the new category column to color:
The numeric columns to collapse into rows. Defaults to all numeric columns.
Columns to carry through unchanged. Defaults to all categorical/temporal
columns.
Name of the output column holding the original column names.
Name of the output column holding the values.
Other transforms
Spec-level vs layer-level
Piping a transform into the spec applies it to all layers. To reshape the data for a single geom — for example, a line overlay that needs a different shape than the bars beneath it — passtransforms on that geom:
Next
- Statistics — per-layer summaries that run after transforms
- Mappings & aesthetics — reference the columns a transform produces

