One of my undergraduate student’s wants to use the World Bank’s Gender database for a class project. Turns out that the data is in “long” format. Each variable and country is a row, and the years are columns. Most statistical analysis of cross-country panel data starts with the data in “long” format, where each observation is a country-year and the columns are variables. Getting R to reshape the data isn’t as easy as one would think. (In Stata is was not so easy either.) The problem is never reshaping with a single variable, but rather reshaping with many variables and also preserving all the labels.

It is probably very clunky. You have to decide in advance which variables to use. And then a lot of cutting and pasting to get all the variables in the code. There must be an easier way but I did not find it. (Of course, the WDI package in R does most of this easily, but here the student wanted to use the Gender database which you download as a csv file.)