1.Loading needed packages

library(tidyverse)
library(sf)
library(rnaturalearth)
library(rnaturalearthdata)
library(eurostat)

2.Getting the price data from EUROSTAT

prc_hicp_mmor <- get_eurostat("prc_hicp_mmor", type = "code", time_format = "date") %>% 
    mutate_if(is_character, as_factor)

3.Getting the mapping data

eurasia <- ne_countries(scale = 50, 
                      type = "countries", 
                      continent = c("Europe", "Asia"),
                      country = NULL, 
                      geounit = NULL, 
                      sovereignty = NULL,
                      returnclass = c("sf")) %>% 
  select(name, iso_a2, continent, subregion, geometry) %>% 
  mutate(iso_a2 = fct_recode(iso_a2, "UK" = "GB", "EL" = "GR"))

4.Price change in 2019 (%)

5.Price change in 2020 (%)

6.Price change in 2021 (%)

7.Price change in 2022 (%) (January to October)

8.Cumulative price change from 2019 to 2022 (%)

*Note: UK data covers only years 2019 and 2020