New registrations of passenger cars by type of motor energy and engine size - road_eqr_carmot

Data - Eurostat

Structure

Diesel Share of New Registrations

France, Germany, Italy

Code
road_eqr_carmot |>
  filter(geo %in% c("FR", "DE", "IT"),
         engine == "TOTAL",
         mot_nrg %in% c("DIE", "TOTAL")) |>
  select(geo, Geo, mot_nrg, time, values) |>
  spread(mot_nrg, values) |>
  mutate(values = DIE / TOTAL) |>
  year_to_date() |>
  arrange(date) |>

  add_flag_color("Geo") |>
  ggplot() + geom_line(aes(x = date, y = values, color = color)) +
  theme_minimal() + scale_color_identity() + add_flags +
  scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  xlab("") + ylab("Diesel share of new car registrations") +
  scale_y_continuous(labels = scales::percent_format(accuracy = 1))

France: Petrol Cars by Engine Size

Less than 1400cc, 1400-1999cc, 2000cc or over

Code
road_eqr_carmot |>
  filter(geo == "FR",
         mot_nrg == "PET",
         engine != "TOTAL") |>
  year_to_date() |>
  arrange(date) |>
  mutate(values = values/1000) |>

  ggplot() + geom_line(aes(x = date, y = values, color = Engine)) +
  theme_minimal() +
  scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  theme(legend.position = c(0.25, 0.85),
        legend.title = element_blank()) +
  xlab("") + ylab("New petrol car registrations") +
  scale_y_continuous(labels = dollar_format(accuracy = 1, prefix = "", suffix = "K"))

Latest Year by Country

Code
latest_y <- road_eqr_carmot |>
  filter(geo == "FR",
         engine == "TOTAL",
         mot_nrg == "TOTAL",
         !is.na(values)) |>
  summarise(m = max(time)) |>
  pull(m)

road_eqr_carmot |>
  filter(geo %in% c("FR", "DE", "IT", "ES", "PT", "EU27_2020"),
         engine == "TOTAL",
         mot_nrg %in% c("DIE", "PET", "TOTAL"),
         time == latest_y) |>
  mutate(values = values/1000) |>
  select(Geo, Mot_nrg, values) |>
  spread(Mot_nrg, values) |>
  arrange(-Total) |>
  print_table_conditional()
Geo Diesel Petrol Total
European Union - 27 countries (from 2020) 1522.343 7221.360 10998.546
Germany 580.059 1720.095 2857.591
France 141.714 1211.273 1750.338
Italy 237.079 1075.387 1550.451
Spain 160.946 880.672 1206.838
Portugal 18.450 133.978 225.243

New registrations of passenger cars in Germany, France, Italy

France, Germany, Italy

Code
road_eqr_carmot |>
  
  filter(geo %in% c("FR", "DE", "IT"),
         engine == "TOTAL",
         mot_nrg == "TOTAL") |>
  year_to_date() |>
  arrange(date) |>
  mutate(values = values/1000) |>
  add_flag_color("Geo") |>
  ggplot() + geom_line(aes(x = date, y = values, color = color)) + 
  theme_minimal() + xlab("") + ylab("New registrations of passenger cars") +
  scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  add_flags + scale_color_identity() +
  scale_y_continuous(breaks = seq(0, 10000, 500),
                     labels = dollar_format(accuracy = 1, prefix = "", suffix = "K"))

Spain, Portugal, Italy

Code
road_eqr_carmot |>
  
  filter(geo %in% c("ES", "PT", "UK"),
         engine == "TOTAL",
         mot_nrg == "TOTAL") |>
  year_to_date() |>
  arrange(date) |>
  mutate(values = values/1000) |>
  add_flag_color("Geo") |>
  ggplot() + geom_line(aes(x = date, y = values, color = color)) + 
  theme_minimal() + xlab("") + ylab("New registrations of passenger cars") +
  scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
               labels = date_format("%Y")) +
  add_flags + scale_color_identity() +
  scale_y_continuous(breaks = seq(0, 10000, 500),
                     labels = dollar_format(accuracy = 1, prefix = "", suffix = "K"))