I have a tibble that looks as follows
tibble(
text = c('text1','text1','text2','text2','text3','text3'),
cell_id = rep(1:3, each=2)
)
text cell_id
<chr> <int>
1 text1 1
2 text1 1
3 text2 2
4 text2 2
5 text3 3
6 text3 3
I want to split the tibble into columns defined by the cell_id, and move the text value into the respective columns
col1 col2 col3
<chr> <chr> <chr>
1 text1 text2 text3
2 text1 text2 text3
What would be the cleanest way to do this?