prc_hpi_hsna %>%
left_join(unit, by = "unit") %>%
group_by(unit, Unit) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
{if (is_html_output()) print_table(.) else .}
unit | Unit | Nobs |
---|---|---|
INX_A_AVG | Annual average index | 452 |
RCH_A_AVG | Annual average rate of change | 443 |
prc_hpi_hsna %>%
left_join(geo, by = "geo") %>%
group_by(geo, Geo) %>%
summarise(Nobs = n()) %>%
arrange(-Nobs) %>%
mutate(Geo = ifelse(geo == "DE", "Germany", Geo)) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(Geo)),
Flag = paste0('<img src="../../bib/flags/vsmall/', Flag, '.png" alt="Flag">')) %>%
select(Flag, everything()) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F, escape = F) else .}
prc_hpi_hsna %>%
filter(geo %in% c("FR", "IT", "DE"),
unit == "INX_A_AVG") %>%
year_to_date %>%
left_join(geo, by = "geo") %>%
ggplot() + geom_line() + theme_minimal() +
aes(x = date, y = values, color = Geo, linetype = Geo) +
scale_color_manual(values = viridis(4)[1:3]) +
scale_x_date(breaks = seq(1920, 2025, 1) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.35, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = seq(-100, 300, 10)) +
ylab("House Price Index") + xlab("")
prc_hpi_hsna %>%
filter(geo %in% c("BE", "DK", "FI"),
unit == "INX_A_AVG") %>%
year_to_date %>%
left_join(geo, by = "geo") %>%
ggplot() + geom_line() + theme_minimal() +
aes(x = date, y = values, color = Geo, linetype = Geo) +
scale_color_manual(values = viridis(4)[1:3]) +
scale_x_date(breaks = seq(1920, 2025, 1) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.35, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = seq(-100, 300, 10)) +
ylab("House Price Index") + xlab("")
prc_hpi_hsna %>%
filter(geo %in% c("FR")) %>%
year_to_date %>%
ggplot() + geom_line() + theme_minimal() +
aes(x = date, y = values, color = unit, linetype = unit) +
scale_color_manual(values = viridis(5)[1:4]) +
scale_x_date(breaks = seq(1920, 2025, 1) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%y")) +
theme(legend.position = c(0.35, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = seq(-100, 300, 10)) +
ylab("House Price Index") + xlab("")