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

Data - Eurostat

Info

DOWNLOAD_TIME

Code
tibble(DOWNLOAD_TIME = as.Date(file.info("~/Library/Mobile\ Documents/com~apple~CloudDocs/website/data/eurostat/road_eqr_carmot.RData")$mtime)) %>%
  print_table_conditional()
DOWNLOAD_TIME
2024-10-08

Last

Code
road_eqr_carmot %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  head(1) %>%
  print_table_conditional()
time Nobs
2023 250

mot_nrg

Code
road_eqr_carmot %>%
  left_join(mot_nrg, by = "mot_nrg") %>%
  group_by(mot_nrg, Mot_nrg) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
mot_nrg Mot_nrg Nobs
PET Petroleum products 2406
DIE Diesel 2384
TOTAL Total 1265

engine

Code
road_eqr_carmot %>%
  left_join(engine, by = "engine") %>%
  group_by(engine, Engine) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  print_table_conditional()
engine Engine Nobs
TOTAL Total 2913
CC1400-1999 From 1 400 to 1 999 cm³ 1054
CC_GE2000 2 000 cm³ or over 1051
CC_LT1400 Less than 1 400 cm³ 1037

geo

Code
road_eqr_carmot %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  mutate(Flag = gsub(" ", "-", str_to_lower(gsub(" ", "-", Geo))),
         Flag = paste0('<img src="../../icon/flag/vsmall/', Flag, '.png" alt="Flag">')) %>%
  select(Flag, everything()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}

time

Code
road_eqr_carmot %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  arrange(desc(time)) %>%
  print_table_conditional()

New registrations of passenger cars in Germany, France, Italy

France, Germany, Italy

Code
road_eqr_carmot %>%
  left_join(geo, by = "geo") %>%
  filter(geo %in% c("FR", "DE", "IT"),
         engine == "TOTAL",
         mot_nrg == "TOTAL") %>%
  year_to_date() %>%
  arrange(date) %>%
  mutate(values = values/1000) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  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, 2020, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  add_3flags + 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 %>%
  left_join(geo, by = "geo") %>%
  filter(geo %in% c("ES", "PT", "UK"),
         engine == "TOTAL",
         mot_nrg == "TOTAL") %>%
  year_to_date() %>%
  arrange(date) %>%
  mutate(values = values/1000) %>%
  left_join(colors, by = c("Geo" = "country")) %>%
  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, 2020, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%Y")) +
  add_3flags + scale_color_identity() +
  scale_y_continuous(breaks = seq(0, 10000, 500),
                     labels = dollar_format(accuracy = 1, prefix = "", suffix = "K"))