Code
%>%
SNA_TABLE7A left_join(SNA_TABLE7A_var %>% pluck("TRANSACT"), by = c("TRANSACT" = "id")) %>%
rename(`TRANSACT Description` = label) %>%
left_join(SNA_TABLE7A_var %>% pluck("ACTIVITY"), by = c("ACTIVITY" = "id")) %>%
rename(`ACTIVITY Description` = label) %>%
group_by(TRANSACT, `TRANSACT Description`, ACTIVITY, `ACTIVITY Description`, MEASURE,) %>%
summarise(nobs = n()) %>%
arrange(-nobs) %>%
if (is_html_output()) datatable(., filter = 'top', rownames = F) else .} {