Retrieving and cleaning data

First things first, we must get data. We also need to clean it before doing any drawing. The wbstats package will be used to get data. It retrieves data from the World Bank Data API. This section will demonstrate how to use wbstats. Data obtained and cleaned through this section are going to be later used to make plots.

Worldwide data about inequality, education, and population will be searched. All of these can be retrieved from the World Bank Database. Start by downloading wbstats if don't have it yet. If you are not sure whether you have it, simply run the following code:

if(!require('wbstats')){install.packages('wbstats')}

Load the wbstats library and enter wbcache() to download an updated list of available ...

Get Hands-On Data Science with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.