library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.4.4     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
# Read the CSV file
data <- read.csv("ED.csv")


# Filter out the "Total" row from the age category
data_filtered <- data %>% filter(Age != "Total") 

# Faceted bar chart 
ggplot(data_filtered, aes(x = YEAR, y = Value, fill = Age)) +
  geom_bar(stat = "identity", position = "dodge") +  
  facet_wrap(~ Country) +
  labs(x = "Year", y = "Excess Deaths", title = "Excess Deaths by Age Group and Country") +
  theme_minimal()