This section uses a real data set to demonstrate how reshaping your data with tidyr
is an integral part of the data exploration process. The data in this example was downloaded from the World Bank Data Explorer, which is a data collection of hundreds of indicators (measures) of different economic and social development factors. In particular, this example considers educational indicators that capture a relevant signal of a country’s level of (or investment in) education— for example, government expenditure on education, literacy rates, school enrollment rates, and dozens of other measures of educational attainment.
In exploring the data through different lenses, the code generates the following figures to make comparisons between countries and over time: