# Spread

Spread a key-value pair across multiple columns. Missing values will be replaced with NA.

## How to Access This Feature

### From + (plus) Button

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oN9AqTA5_brwGuyhT%2Fcommand-spread-df-menu.png?generation=1586795466509322\&alt=media)

* Click "+" button and select "Spread (Pivot)".

### From Column Menu

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oN9Asi29QUEG9EYvN%2Fcommand-spread-column-menu.png?generation=1586795466241818\&alt=media)

* You can also select two columns for key/value first, and then select "Spread (Pivot)" from the column menu of one of the selected columns.

## Spread a Key/Value Column Pair across Multiple Columns

![](https://2850417076-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4HLCK3olgduYoe3RVS%2F-M4oMvCUDQwHTJ0eWi_f%2F-M4oN9AuSOVuXgIhrUHX%2Fspread.png?generation=1586795466333028\&alt=media)

1. Select Columns to Spread

* Select Key/Value Columns from "Key Column"/"Value Column" dropdown.

1. Specify parameters in the "Parameters" section.

* Fill NA with - Value to fill missing values.
* Guess column data type - Select TRUE to automatically guess the most possible data type for the key column.
* Drop empty columns - The default is TRUE. Set FALSE to keep the levels that don’t appear in the data, filling in missing combinations with the text set with 'Fill NA with' field.
* Column Names Separator - The default is NULL. If NULL, the column names are values of the key column. Set separator text to make the column names "{key\_column\_name}{separator}{key\_value}".

1. Click "Run".
