Thierry Warin



spiR is an R wrapper to easily access the Social Progress Index database. Published by the Social Progress Imperative, a global non profit based in Washington, DC, the index proposes a new perspective on social challenges and needed efforts to accelerate social progress in line with the Sustainable Development Goals. In this context, the goal of spiR is to allow an easy connection with R to the Social Progress Index in order to benefit from the “power of the crowds.”

At the Social Progress Imperative, they define “social progress as the capacity of a society to meet the basic human needs of its citizens, establish the building blocks that allow citizens and communities to enhance and sustain the quality of their lives, and create the conditions for all individuals to reach their full potential. Improving quality of life is a complex task and past efforts to measure progress simply haven’t created a sufficiently nuanced picture of what a successful society looks like. That’s why we created the Social Progress Index. Rather than emphasizing traditional measurements of success like income and investment, we measure 51 social and environmental indicators to create a clearer picture of what life is really like for everyday people. The index doesn’t measure people’s happiness or life satisfaction, focusing instead on actual life outcomes in areas from shelter and nutrition to rights and education. This exclusive focus on measurable outcomes makes the index a useful policy tool that tracks changes in society over time.”

The index measures the quality of life for 98% of the world’s population. In its current version, the R client provides access to global data. In further versions, this R client will include different geographical levels: states, regions, cities and sometimes communities.

Three overarching dimensions are (1) Basic Human Needs, (2) Foundations of Wellbeing, and (3) Opportunity. Within each dimension, there are four components that further divide the indicators into thematic categories. The index consists in 51 social and environmental variables, covering the years 2014 to 2019. To see a definition of the indicators, please visit this page. See below to have access through spiR to the whole list of indicators.

Users can recreate in R impactful dashboards and visualizations as the ones found on <www.socialprogress.org>:

Practical usage

Quick start

First, install spiR:

Next, call spiR to make sure everything is installed correctly.


Step 1: Getting the country’s ISO code

A user needs to enter the ISO code of a country. To have access to this code, the following function provides this information.

Step 2: Getting the indicator’s code

A user needs to enter the code of the desired indicator. To do so, the following function provides access to all the indicators of interest.