I'm not sure if this belongs here, but hopefully there's a simple solution. I couldn't render a reprex due to some HTML issue, but I guess it's not THAT important in this case.
library(janitor)
library(kableExtra)
library(dplyr)
# Nice
mtcars %>%
tabyl(vs, gear) %>%
adorn_totals(c("row", "col")) %>%
adorn_percentages("all") %>%
adorn_pct_formatting() %>%
adorn_ns(position = "front") %>%
adorn_title() %>%
kable() %>%
kable_styling(bootstrap_options = c("condensed", "striped", "bordered"))
# Adding another group to tabyl()
mtcars %>%
tabyl(vs, gear, cyl) %>%
adorn_totals(c("row", "col")) %>%
adorn_percentages("all") %>%
adorn_pct_formatting() %>%
adorn_ns(position = "front") %>%
adorn_title()
# Not so nice.
mtcars %>%
tabyl(vs, gear, cyl) %>%
adorn_totals(c("row", "col")) %>%
adorn_percentages("all") %>%
adorn_pct_formatting() %>%
adorn_ns(position = "front") %>%
adorn_title() %>%
kable() %>%
kable_styling(bootstrap_options = c("condensed", "striped", "bordered"))
Is there a way to keep the "native" output of janitor in section 2 while using kable
? I'd like the output as rows per cyl
. You'll see what I mean if you run the code..
Thank you!