Import data
# excel file
data <- read_excel("data/myData.xlsx")
data
## # A tibble: 193 × 9
## hdi_rank_2023 country human_development_in…¹ life_expectancy_at_b…²
## <dbl> <chr> <dbl> <dbl>
## 1 1 Iceland 0.972 82.7
## 2 2 Norway 0.97 83.3
## 3 2 Switzerland 0.97 84.0
## 4 4 Denmark 0.962 81.9
## 5 5 Germany 0.959 81.4
## 6 5 Sweden 0.959 83.3
## 7 7 Australia 0.958 83.9
## 8 8 Hong Kong, China… 0.955 85.5
## 9 8 Netherlands 0.955 82.2
## 10 10 Belgium 0.951 82.1
## # ℹ 183 more rows
## # ℹ abbreviated names: ¹​human_development_index_hdi, ²​life_expectancy_at_birth
## # ℹ 5 more variables: expected_years_of_schooling <dbl>,
## # mean_years_of_schooling <dbl>, gross_national_income_gni_per_capita <dbl>,
## # gni_per_capita_rank_minus_hdi_rank <dbl>, hdi_rank_2022 <chr>
Plot histogram data
ggplot(data, aes(x = human_development_index_hdi)) + geom_histogram(
fill = "cornflowerblue",
color = "white",
binwidth = 0.05) +
labs(
title = "Countries by HDI",
subtitle = "Binwidth = 0.05",
x = "HDI")
