Passenger cars, by age - road_eqs_carage

Data - Eurostat

age

Code
road_eqs_carage %>%
  left_join(age, by = "age") %>%
  group_by(age, Age) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
age Age Nobs
TOTAL Total 455
Y2-5 From 2 to 5 years 381
Y5-10 From 5 to 10 years 381
Y_LT2 Less than 2 years 381
Y10-20 From 10 to 20 years 377
Y_GT20 Over 20 years 312

geo

Code
road_eqs_carage %>%
  left_join(geo, by = "geo") %>%
  group_by(geo, Geo) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

New registrations of passenger cars in Germany, France, Italy

Code
road_eqs_carage %>%
  left_join(geo, by = "geo") %>%
  filter(geo %in% c("FR", "DE", "IT"),
         age == "TOTAL") %>%
  year_to_date() %>%
  arrange(date) %>%
  ggplot(.) + geom_line(aes(x = date, y = values/1000000, color = Geo, linetype = Geo)) + 
  theme_minimal() + xlab("") + ylab("Passenger cars") +
  scale_x_date(breaks = seq(1960, 2020, 5) %>% paste0("-01-01") %>% as.Date,
               labels = date_format("%y")) +
  scale_y_continuous(breaks = seq(0, 100, 5),
                     labels = dollar_format(accuracy = 1, prefix = "", suffix = "M")) +
  scale_color_manual(values = viridis(5)[1:4]) +
  theme(legend.position = c(0.2, 0.80),
        legend.title = element_blank())