When downloading data from WorldBank, the default export format is not friendly for quick further use of this data. By default, variables are downloaded in rows, while years are downloaded in column dimensions. This is not a typical database layout, which makes it difficult to further process the information.
In order to save manual monotonous work for WorldBank users, we started our project by creating a custom R-package for fast transformation of data retrieved from WorldBank.
The package is called WBReader and is now installable from github: https://github.com/kerajxl/WBreader
The function included in the package has the following parameters:
wb_read_excel <- function(path, extension = 'xlsx', keep_NA = FALSE, preview = FALSE,
iso_coding = '2c', prettyValue = TRUE) {
...
...
...
return(df)
}
Let’s see how our package works in practice. Below the head() function on the loaded original data:
data <- read_xlsx('Data_Extract_From_World_Development_Indicators.xlsx')
datatable(head(data[,0:6]))
Below is the data after reading it using our package:
data <- WBreader::wb_read_excel(path = 'Data_Extract_From_World_Development_Indicators.xlsx')
datatable(head(data))
Our application is structured in a classic SideBarPanel layout.
By default, the dataset downloaded by us from Worldbank is uploaded.
However, on the left side the user can upload his dataset from a local file, which the application will process itself by passing it through our WBReader package.
The user then selects the countries, indicators, and range of years they want to analyze.
In the top right corner, the user can expand the panel to customize the theme of the application (background, fonts and many more). The right side of the application contains tabs showing different ways to analyze the uploaded data. Several of them are already finished and we will present them further in the presentation.
In this tab, we created an interactive table using the DT package. The user has full control over the view, filtering and moving between pages.
In this tab, the user will have a choice of one of three charts:
Of course the chart is fully interactive, there is a choice of countries, date range and indicators.
This tab has the ability to generate a bar race type animation.
It is extremely interesting because it contains simulations of various indicators over time.
After selecting the countries, indicator, date range and clicking play, an animation will play containing the top 25 countries for the year, which will be represented by flags.
Scatter plot tab also contains animations.
This time it shows a two-dimensional scatter plot, where the user can see how the relationships between selected components in selected countries have changed over time.
The countries are also shown as flags which enhances the visual effect.
The user can also adjust the size of the flag and export the animation as a gif to a local disk.
Last but not least tab will be an interactive game, in which the player may test her/his knowledge about selected countries :) We are planning to include questions such as:
Digesting and understanding data is much more pleasant when the data is in nice format. It is even nicer when you explore it with charts and animations, hence the idea for our project. We wanted to create something useful and which pleases the eye.