I apologize ahead of time if this has been answered. I just can not find anything for this specific situation.
Anyways, I have a table that looks like so:
Country code Year_1960 Year_1961 Year_1962 Year_1963 Year_1964
<chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Afghanistan AFG 8996351 9166764 9345868 9533954 9731361
2 Albania ALB 1608800 1659800 1711319 1762621 1814135
3 Algeria DZA 11124888 11404859 11690153 11985136 12295970
4 American Sam~ ASM 20013 20486 21117 21882 22698
5 Andorra AND 13411 14375 15370 16412 17469
6 Angola AGO 5643182 5753024 5866061 5980417 6093321
Notice how each distinct year is a header. I want to make this table into a long format. The Country and code features are already in that format. How do I go about doing this?
I have tried melt(), reshape(), etc. I am struggling. Thank you ahead of time for helping.