spiR

Officially part of The Comprehensive R Archive Network.

Anne Sophie Gill https://www.skemagloballab.io/gillAnneSophie.html (SKEMA Global Lab in AI)https://skemagloballab.io , Marine Leroi https://www.skemagloballab.io/leroiMarine.html (SKEMA Global Lab in AI)https://skemagloballab.io , Martin Paquette https://www.skemagloballab.io/paquetteMartin.html (SKEMA Global Lab in AI)https://skemagloballab.io , Antoine Debien https://www.skemagloballab.io/debienAntoine.html (SKEMA Global Lab in AI)https://skemagloballab.io , Thierry Warin https://www.nuance-r.com/principalInvestigator.html (SKEMA Business School (Raleigh, NC))https://www.skemagloballab.io
01-24-2020

Great news everyone, since January 24th 2020, our API spiR is now part of CRAN !

Recreate impactful dashboards and visualizations as the ones found on the Social Progress Imperative directly from the #SKEMAQuantumStudio(Warin 2019) framework !

“The Social Progress Index is a new way to define the success of our societies. It is a comprehensive measure of real quality of life, independent of economic indicators. The Social Progress Index is designed to complement, rather than replace, economic measures such as GDP.” (The Social Progress Imperative, 2018)

Here are some example of code to use with our spiR package

Example 1 : Social Progress Index of different countries since 2014


library(spiR)
library(kableExtra)
library(ggplot2)
library(dplyr)

myData <- sqs_spi_data(country = c("USA", "FRA", "BRA", "CHN", "ZAF", "CAN"), 
                       year = c("2014","2015","2016", "2017", "2018", "2019"), 
                       indicators = "SPI")

myData$value <- as.numeric(myData$value)

kable(myData)%>%
scroll_box(width = "100%", height = "200px")
countryName var_code var_year var_indicator value
Brazil BRA 2014 SPI 73.59
Canada CAN 2014 SPI 86.97
China CHN 2014 SPI 61.58
France FRA 2014 SPI 87.10
South Africa ZAF 2014 SPI 64.65
United States USA 2014 SPI 84.74
Brazil BRA 2015 SPI 73.45
Canada CAN 2015 SPI 87.17
China CHN 2015 SPI 62.38
France FRA 2015 SPI 87.19
South Africa ZAF 2015 SPI 65.38
United States USA 2015 SPI 84.71
Brazil BRA 2016 SPI 74.12
Canada CAN 2016 SPI 87.25
China CHN 2016 SPI 62.89
France FRA 2016 SPI 87.48
South Africa ZAF 2016 SPI 66.19
United States USA 2016 SPI 85.09
Brazil BRA 2017 SPI 72.80
Canada CAN 2017 SPI 87.79
China CHN 2017 SPI 63.73
France FRA 2017 SPI 87.60
South Africa ZAF 2017 SPI 66.74
United States USA 2017 SPI 84.18
Brazil BRA 2018 SPI 72.66
Canada CAN 2018 SPI 88.60
China CHN 2018 SPI 64.16
France FRA 2018 SPI 87.69
South Africa ZAF 2018 SPI 66.56
United States USA 2018 SPI 83.85
Brazil BRA 2019 SPI 72.87
Canada CAN 2019 SPI 88.81
China CHN 2019 SPI 64.54
France FRA 2019 SPI 87.79
South Africa ZAF 2019 SPI 67.44
United States USA 2019 SPI 83.62

ggplot(data = myData, aes(x = var_year, y = value, color = countryName)) + 
  geom_line() +
  theme_bw() +
  theme(plot.title = element_text(hjust = 0.5)) + 
  labs(title = "Social Progress Index of different countries since 2014",
       x = "Years",
       y = "Social Progress Index Score",
       colour = "Countries",
       caption = "Source: SKEMA Quantum Studio")

Example 2 : Social Progress Index of different countries in 2019


library(spiR)
library(kableExtra)
library(ggplot2)
library(dplyr)

myData <- sqs_spi_data(country = c("USA", "FRA", "BRA", "CHN", "ZAF", "CAN"), 
                       year = c("2019"), 
                       indicators = "SPI")

myData$value <- as.numeric(myData$value)

kable(myData)%>%
scroll_box(width = "100%", height = "200px")
countryName var_code var_year var_indicator value
Brazil BRA 2019 SPI 72.87
Canada CAN 2019 SPI 88.81
China CHN 2019 SPI 64.54
France FRA 2019 SPI 87.79
South Africa ZAF 2019 SPI 67.44
United States USA 2019 SPI 83.62

ggplot(data = myData, aes(x = countryName, y = value, fill = countryName)) + 
  geom_col() +
  theme_bw() +
  theme(plot.title = element_text(hjust = 0.5)) +
  labs(title = "Social Progress Index of different countries in 2019",
       x = "Countries",
       y = "Social Progress Index Score",
       colour = "Countries",
       caption = "Source: SKEMA Quantum Studio")


We hope you enjoy using this package as much as we do ! spiR is very useful to measure the extent to which countries provide for the social and environmental needs of their citizens.


Follow SKEMA Global Lab in Augmented Intelligence

Warin, Thierry. 2019. “SKEMA Quantum Studio: A Technological Framework for Data Science in Higher Education.” https://doi.org/10.6084/m9.figshare.8204195.v2.

Citation

For attribution, please cite this work as

Gill, et al. (2020, Jan. 24). Blog: spiR. Retrieved from https://blog.skemagloballab.io/posts/2020-01-24-spiR/

BibTeX citation

@misc{gill2020spir,
  author = {Gill, Anne Sophie and Leroi, Marine and Paquette, Martin and Debien, Antoine and Warin, Thierry},
  title = {Blog: spiR},
  url = {https://blog.skemagloballab.io/posts/2020-01-24-spiR/},
  year = {2020}
}