Printing nice cross-tabulations in knitr
An alternative to kable
is pander
from the package with the same name, which provides an easy way of generating markdown tables with bunch of options (like style
) and a generic S3 method:
> pander(x)------------------- A B C ------- --- --- --- **D** 15 9 7 **E** 13 14 9 **F** 8 8 17 -------------------> pander(f)----- ----- --- --- --- "Col" "A" "B" "C""Row" "D" 15 9 7 "E" 13 14 9 "F" 8 8 17 ----- ----- --- --- ---
If you want to generate the old rmarkdown
-style pipe tables, add stlye='rmarkdown'
parameter, although AFAIK Pandoc is the new standard there as well, which supports the above multi-line table.