2023-05-01

Overview

  • The objective of this Shiny app is to visualize the distribution of Happiness Index scores and rankings by country.
  • Happiness index data for 2018 and 2019 are available.
  • In addition to the overall happiness scores/rankings, the user can view scores from components used to calculate the happiness index:
    • GDP per capita
    • social support
    • healthy life expectancy
    • freedom to make life choices
    • generosity
    • perceptions of corruption

Dataset

  • The global happiness index dataset provides the following information:
    • country/region name
    • year for which happiness index was calculated (2018 or 2019)
    • happiness index ranking and score
    • scores of components used to calculate happiness score
head(happiness.data)
##   rank      region year score   GDP social  life choices generosity corruption
## 1  154 Afghanistan 2019 3.203 0.350  0.517 0.361   0.000      0.158      0.025
## 2  145 Afghanistan 2018 3.632 0.332  0.537 0.255   0.085      0.191      0.036
## 3  107     Albania 2019 4.719 0.947  0.848 0.874   0.383      0.178      0.027
## 4  112     Albania 2018 4.586 0.916  0.817 0.790   0.419      0.149      0.032
## 5   88     Algeria 2019 5.211 1.002  1.160 0.785   0.086      0.073      0.114
## 6   84     Algeria 2018 5.295 0.979  1.154 0.687   0.077      0.055      0.135

How to Use App

  • Select score to display from the dropdown menu.
  • Select year from which results will be displayed by clicking on the corresponding button.
  • Select how many top-ranked countries for specified category and year to list by using the numeric input box.

Links to App, Code