Hi Guys,
How to reshape my data from long to wide using Pivot wide in R.
I would like to change my dataset from
date | Countries | Set 1 | Set 2 | Set 3 |
---|---|---|---|---|
20/01/2018 | Europe | 6 | 1 | 5 |
20/01/2018 | US | 0 | 3 | 3 |
25/01/2020 | Europe | 1 | 1 | 2 |
25/01/2018 | US | 0 | 3 | 6 |
27/01/2018 | Europe | 4 | 3 | 4 |
27/01/2018 | US | 2 | 1 | 1 |
to
Date | Europe Set 1 | US Set 1 | Europe Set 2 | US Set 2 | Europe Set 3 | US Set 3 |
---|---|---|---|---|---|---|
20/01/2018 | 6 | 0 | 1 | 3 | 5 | 3 |
25/01/2018 | 1 | 0 | 1 | 3 | 2 | 6 |
27/01/2018 | 4 | 2 | 3 | 1 | 4 | 1 |
Many thanks