My dataset looks like the following:
identification number | year | indicator | Data |
---|---|---|---|
1112000 | 2000 | JKL_ADS | 511 |
1112001 | 2001 | JKL_ADS | 517 |
1112002 | 2002 | JKL_ADS | 721 |
1112003 | 2003 | JKL_ADS | 925 |
1112004 | 2004 | JKL_ADS | 1092 |
1112000 | 2000 | KLS_DSAK | 351 |
1112001 | 2001 | KLS_DSAK | 631 |
1112002 | 2002 | KLS_DSAK | 732 |
1112003 | 2003 | KLS_DSAK | 823 |
1112004 | 2004 | KLS_DSAK | 1092 |
I want to reshape wide so it looks like this instead:
identification number | year | JKL_ADS | KLS_DSAK |
---|---|---|---|
1112000 | 2000 | 511 | 351 |
1112001 | 2001 | 517 | 631 |
1112002 | 2002 | 721 | 732 |
1112003 | 2003 | 925 | 823 |
1112004 | 2004 | 1092 | 1092 |
This is a fairly standard application. You didn't give example data in recommended form, so the details here may need modification by you.
Contrary to the question,
indicator
serves as an argument toj()
.