Code
%>%
EAR_XEES_SEX_ECO_NB_Q left_join(ref_area, by = "ref_area") %>%
group_by(ref_area, Ref_area) %>%
summarise(Nobs = n()) %>%
mutate(Flag = gsub(" ", "-", str_to_lower(Ref_area)),
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 .} {