sdg_08_11 %>%
mutate(time = as.numeric(time)) %>%
filter(time >= 2010) %>%
group_by(geo, indic) %>%
summarise(values = mean(values, na.rm = T)) %>%
ungroup %>%
left_join(indic, by = "indic") %>%
left_join(geo, by = "geo") %>%
mutate(Indic = gsub(" investment", "", Indic)) %>%
select(Indic, `Investment 2010-19 (% of GDP)` = Geo, values) %>%
spread(Indic, values) %>%
arrange(-Government) %>%
mutate_at(vars(-1), funs(percent(./100, accuracy = 0.1))) %>%
select(1, 5, 2, 3, 4) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}