Code
%>%
BSI left_join(BSI_var %>% pluck("VAR"), by = c("VAR" = "id")) %>%
rename(`VAR Description` = label) %>%
left_join(BSI_var %>% pluck("ITYP"), by = c("ITYP" = "id")) %>%
rename(`ITYP Description` = label) %>%
group_by(VAR, `VAR Description`, ITYP, `ITYP Description`, TYP, CUR) %>%
summarise(nobs = n()) %>%
arrange(-nobs) %>%
if (is_html_output()) datatable(., filter = 'top', rownames = F) else .} {