I've trying to unsucessfully do this in R:
I have data in the format:
| Code | 2004 | 2005 |
|---|---|---|
| 120005 | 4 | 2 |
| 120010 | 0 | 1 |
And I want to convert the data to this:
| Code | Year | Value |
|---|---|---|
| 120005 | 2004 | 4 |
| 120005 | 2005 | 2 |
| 120010 | 2004 | 0 |
| 120010 | 2005 | 1 |
How would you do it?
I've trying to unsucessfully do this in R:
I have data in the format:
| Code | 2004 | 2005 |
|---|---|---|
| 120005 | 4 | 2 |
| 120010 | 0 | 1 |
And I want to convert the data to this:
| Code | Year | Value |
|---|---|---|
| 120005 | 2004 | 4 |
| 120005 | 2005 | 2 |
| 120010 | 2004 | 0 |
| 120010 | 2005 | 1 |
How would you do it?