pander
pander copied to clipboard
pander.ftable issues/not as pretty as pander.tabular?
I'd like to use pander.ftable as recommended e.g. here to get nice tabular output with dimnames (row/column names) preserved ... I'm having some difficulties (sorry/thanks for your patience if these are really rmarkdown rather than pander issues ...)
After I convert my tables via ftable(), I do get the dimnames preserved, but I lose a lot of the nice formatting - separator lines are missing, and the row/column names are no longer boldfaced. I've poked at this a little bit but haven't found an easy solution yet ... suggestions?
update: this helps a bit ...
pftab <- function(tt) {
pander(ftable(tt),emphasize.strong.rows=1,emphasize.strong.cols=1)
}
but the results are still not as pretty as I'd like (justification, separators, ...)
Good catch! This is because t1 has a header:
> pander::pander(t1)
----------------
A B
-------- --- ---
**a** 6 4
**b** 4 6
----------------
While f1 is a matrix with no header (eg the first line is just a normal line instead of being a header):
> pander::pander(f1)
---- ---- --- ---
x2 A B
x1
a 6 4
b 4 6
---- ---- --- ---
Honestly, I'm not that familiar with the ftable class, so asking for help here. Should we always suppose that the first line of an ftable object should be rendered as a table header?