DanChaltiel / crosstable

Easy and thorough description of datasets
https://danchaltiel.github.io/crosstable/
112 stars 8 forks source link

as_flextable() badly formatted when drop_levels=FALSE and one level is absent #70

Closed DanChaltiel closed 2 months ago

DanChaltiel commented 5 months ago
a = mtcars2 %>% 
  mutate(am=fct_expand(am, "other"))
a %>% pull(am) %>% levels
a %>% crosstable(am, drop_levels=FALSE) %>% af #OK
a %>% crosstable(cyl, by=am, drop_levels=FALSE) %>% af #not OK

image