I am currently working on a super long dataframe in R that looks like this
| Year | Value |
|---|---|
| 1912 | 0.5 |
| 1912 | 0.6 |
| 1913 | 0.2 |
| 1913 | 0.3 |
| 1914 | 1.4 |
| 1915 | 1.2 |
And I need to switch the position every two rows so that it looks like this
| Year | Value |
|---|---|
| 1912 | 0.6 |
| 1912 | 0.5 |
| 1913 | 0.3 |
| 1913 | 0.2 |
| 1914 | 1.2 |
| 1915 | 1.4 |
I feel so confused about if there is anything I can do to achieve that or I need to write the function by myself