I have a data frame in the wide format as shown below
site Mean VV 2019 Mean Lst 2019 Mean Vv 2020 Mean Lst 2020 Mean VV 2021 Mean Lst 2021
1 -2 -4 -6.7 -10 -1.67 -24
2 -11 -19 -20 -8 -13 -5
I want to reshape in to longer format as shown below
site Mean VV Mean LST Year
1 -2 -4 2019
1 -6.7 -10 2020
1 -1.67 -24 2021
2 -8 -16 2019
2 -5 -12 2020
2 -18 -20 2021
I have used pivot_longer from the tidyr package but it is not producing the desired result. I need year-wise data in the row. I know its a very simple task but righ now I am stucked with this and I will appreciate any help.