Fertility indicators by NUTS 3 region - demo_r_find3

Data - Eurostat

indic_de

Code
demo_r_find3 %>%
  left_join(indic_de, by = "indic_de") %>%
  group_by(indic_de, Indic_de) %>%
  summarise(Nobs = n()) %>%
  arrange(-Nobs) %>%
  {if (is_html_output()) print_table(.) else .}
indic_de Indic_de Nobs
MEDAGEMOTH Median age of women at childbirth 19064
AGEMOTH Mean age of women at childbirth 17606
TOTFERRT Total fertility rate 17605

geo

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

time

Code
demo_r_find3 %>%
  group_by(time) %>%
  summarise(Nobs = n()) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Mean Age at Birth (AGEMOTH)

Table

Code
demo_r_find3 %>%
  filter(indic_de == "AGEMOTH", 
         nchar(geo) == 5,
         time == "2018") %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Map

Code
demo_r_find3 %>%
  filter(indic_de == "AGEMOTH", 
         nchar(geo) == 5,
         time == "2018") %>%
  select(geo, values) %>%
  left_join(geo, by = "geo") %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33, values <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = values)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = ""),
                       breaks = seq(20, 40, 2),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Mean Age of Birth")

Median Age at Birth (MEDAGEMOTH)

Table

Code
demo_r_find3 %>%
  filter(indic_de == "MEDAGEMOTH", 
         nchar(geo) == 5,
         time == "2018") %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Map

Code
demo_r_find3 %>%
  filter(indic_de == "MEDAGEMOTH", 
         nchar(geo) == 5,
         time == "2018") %>%
  select(geo, values) %>%
  left_join(geo, by = "geo") %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33, values <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = values)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = 1, prefix = "", suffix = ""),
                       breaks = seq(20, 40, 2),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Median Age of Birth")

Total fertility rate (TOTFERRT)

Table

Code
demo_r_find3 %>%
  filter(indic_de == "TOTFERRT", 
         nchar(geo) == 5,
         time == "2018") %>%
  left_join(geo, by = "geo") %>%
  select(geo, Geo, values) %>%
  {if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}

Map

Code
demo_r_find3 %>%
  filter(indic_de == "TOTFERRT", 
         nchar(geo) == 5,
         time == "2018") %>%
  select(geo, values) %>%
  left_join(geo, by = "geo") %>%
  right_join(europe_NUTS3, by = "geo") %>%
  filter(long >= -15, lat >= 33, values <= 80000) %>%
  ggplot(., aes(x = long, y = lat, group = group, fill = values)) +
  geom_polygon() + coord_map() +
  scale_fill_viridis_c(na.value = "white",
                       labels = scales::dollar_format(accuracy = .1, prefix = "", suffix = ""),
                       values = c(0, 0.05, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 1),
                       breaks = seq(0, 4, 0.5),
                       direction = -1) +
  theme_void() + theme(legend.position = c(0.25, 0.85)) + 
  labs(fill = "Fertility Rate")