Code
tibble(DOWNLOAD_TIME = as.Date(file.info("~/iCloud/website/data/eurostat/road_eqr_carmot.RData")$mtime)) %>%
print_table_conditional()| DOWNLOAD_TIME |
|---|
| 2025-11-16 |
Data - Eurostat
tibble(DOWNLOAD_TIME = as.Date(file.info("~/iCloud/website/data/eurostat/road_eqr_carmot.RData")$mtime)) %>%
print_table_conditional()| DOWNLOAD_TIME |
|---|
| 2025-11-16 |
road_eqr_carmot %>%
group_by(time) %>%
summarise(Nobs = n()) %>%
arrange(desc(time)) %>%
head(1) %>%
print_table_conditional()| time | Nobs |
|---|---|
| 2024 | 298 |
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 | 2546 |
| DIE | Diesel | 2533 |
| TOTAL | Total | 1320 |
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 | 3080 |
| CC1400-1999 | From 1 400 to 1 999 cm³ | 1113 |
| CC_GE2000 | 2 000 cm³ or over | 1110 |
| CC_LT1400 | Less than 1 400 cm³ | 1096 |
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 .}road_eqr_carmot %>%
group_by(time) %>%
summarise(Nobs = n()) %>%
arrange(desc(time)) %>%
print_table_conditional()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"))
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"))