indexed 0B in 0s, 0B/s
indexed 2.15GB in 0s, 2.15GB/s
Table nama_10_pc cached at C:\Users\User\AppData\Local\Temp\RtmpAXZhPk/eurostat/dea8e78cad1ed5f1d237fc09e91d8348.rds
countries <-c("DE", "FR", "NL", "PL", "EU27_2020")target_years <-2020:2024filtered_data <- gdp_pc %>%filter( geo %in% countries, TIME_PERIOD %in%2020:2024, na_item =="B1GQ", unit =="CLV10_EUR_HAB", # real GDP per capita!is.na(values) )ggplot(filtered_data, aes(x =factor(TIME_PERIOD), y = values, fill = geo)) +geom_bar(stat ="identity", position ="dodge") +labs(title ="Real GDP per Capita in EUR (2010 prices) (2020–2024)",x ="Year",y ="GDP per Capita (EUR, constant 2010 prices)",fill ="Country" ) +theme_minimal() +theme(legend.position ="right")
World bank data on GDP
library(WDI)
Warning: package 'WDI' was built under R version 4.4.3
countries <-c("DE", "FR", "NL", "PL", "GB", "UA")indicators <-c("NY.GDP.PCAP.CD", # GDP per capita (current US$)"SH.STA.DIAB.ZS"# Diabetes prevalence (% of population ages 20 to 79))data <-WDI(country = countries, indicator = indicators, start =2019, end =2023)head(data)
country iso2c iso3c year NY.GDP.PCAP.CD SH.STA.DIAB.ZS
1 France FR FRA 2019 40408.28 NA
2 France FR FRA 2020 39169.86 NA
3 France FR FRA 2021 43725.10 5.3
4 France FR FRA 2022 41082.81 NA
5 France FR FRA 2023 44690.93 NA
6 Germany DE DEU 2019 47623.87 NA
gdp_data <- data %>%filter(!is.na(NY.GDP.PCAP.CD))ggplot(gdp_data, aes(x = year, y = NY.GDP.PCAP.CD, color = country)) +geom_line(size =1.2) +geom_point(size =2) +labs(title ="GDP per Capita Over Time",x ="Year",y ="GDP per Capita (current US$)",color ="Country" ) +theme_minimal() +theme(plot.title =element_text(hjust =0.5))
Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
Elderly population
elderly_data <-WDI(country = countries,indicator ="SP.POP.65UP.TO.ZS",start =2022,end =2023)elderly_latest <- elderly_data %>%group_by(country) %>%filter(year ==max(year)) %>%ungroup()elderly_latest <- elderly_latest %>%rename(elderly_pct = SP.POP.65UP.TO.ZS)ggplot(elderly_latest, aes(x =reorder(country, elderly_pct), y = elderly_pct, fill = country)) +geom_col(show.legend =FALSE) +coord_flip() +labs(title ="Elderly Population (% of total) in 2023",x ="Country",y ="Population aged 65+ (%)" ) +theme_minimal()