Imagine that I have a column like column\_1, but with 5 million rows. 

```
column_1 
 x1
 x1    
 x2
 x3
 x4
 x5

```

I want to spread the column, into different new columns like this: 

```
x1  x2  x3 x4 x5
1   0   0   0  0 
1   0   0   0  0 
0   1   0   0  0 
0   0   1   0  0 
0   0   0   1  0 
0   0   0   0  1 

```

Therefore I used the spread function: 

```
spread(data = df, key = column_1, value = column_1, fill = "0") 

```

And that works. But, because I got very, very much unique values.. the result (in reality) is +700 columns. 

**My question: How can I do this spread function, with the top 10 most frequent values?** 

The other values, can be grouped in another column (let's say.. column\_bin).