Rows: 285 Columns: 4
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): entity, code, continent
dbl (1): year
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# A tibble: 6 × 4
entity code year continent
<chr> <chr> <dbl> <chr>
1 Abkhazia OWID_ABK 2015 Asia
2 Afghanistan AFG 2015 Asia
3 Akrotiri and Dhekelia OWID_AKD 2015 Asia
4 Aland Islands ALA 2015 Europe
5 Albania ALB 2015 Europe
6 Algeria DZA 2015 Africa
Filter the populiation by 2023 only
#Label - Population only 2023population <- population |>select(series_name, country_code,'2023') |>rename(population ='2023')
Which variable will we use to join the poulation and continents dataframes?
#population country code & conintents codepopulation_continents <- population |>left_join(continents,select(code,continent),by =join_by(country_code == code))
###There are some countries in the population dataset that are not in the continents dataset. Let’s find out which ones are missing.
#population country code & conintents codepopulation_continents |>filter(is.na(continent))
# A tibble: 2 × 6
series_name country_code population entity year continent
<chr> <chr> <dbl> <chr> <dbl> <chr>
1 Population, total CHI 175346 <NA> NA <NA>
2 Population, total XKX 1756374 <NA> NA <NA>
#population country code & conintents codeggplot(population_summary, aes(x = continent, y = total_population)) +geom_bar(stat ="identity", fill ="steelblue") +labs(title ="Total Population by Continent in 2023",x ="Continent",y ="Total Population") +theme_minimal()
#population country code & conintents codeggplot(population_summary, aes(y = continent, x = total_population)) +geom_point() +geom_segment(aes(x =0, xend = total_population, y = continent, yend = continent), color ="gray") +labs(title ="Total Population by Continent in 2023")