0

for the purpose of exporting a results table into word using R markdown, I found that pander has fulfilled almost all my needs. However, after a lot of searching I couldn't find a way to indent some of the row names in my table (the equivalent to add_indent in kable). For example, the first row's name is: "Level 1", and than I want the second row's name ("intercept") to be indented right. Is this possible? (I found pandoc.indent but didn't succeed in applying it on my table).
Attached is the current code I use for the table.

library(pander)
set.alignment('center', row.names = 'left')
panderOptions('missing', '')
pander::pander(df,split.cell = c(50,15,15,15), split.table = Inf, 
           emphasize.rownames = FALSE)  

Thanks!

NoamMm
  • 21
  • 1
  • 3
  • AFAIK the markdown specification doesn't allow specifying the indentation per row -- you specify left/right/center alignment per column. – daroczig Jun 03 '18 at 19:11
  • This specific specification or in general? Because I know that `add_ident` in `kable` does enable indentation per row (at least in row names it was possible. – NoamMm Jun 03 '18 at 20:42
  • Ah, you mean `kableExtra` -- which is a great package to generate customized HTML or LaTeX output, but `pander` generates markdown (that can be then converted to other formats) which does not support these kind of things: https://pandoc.org/MANUAL.html#tables – daroczig Jun 04 '18 at 00:01
  • 1
    Oh, ok. I wanted to make sure I'm not missing an option to do this. Thanks. – NoamMm Jun 04 '18 at 08:25

0 Answers0