2

If I run a linear regression with significance stars, render it through pander, and "Knit PDF" such as this: pander(lm(crimerate ~ conscripted + birthyr + indigenous + naturalized, data = data), add.significance.stars = T)

I occasionally get output where there is weird spacing issues between rows in the output table.

enter image description here

I've tried setting pander options to report fewer digits panderOptions('digits', 2), but the problem persists.

Does anybody have any ideas?

Parseltongue
  • 11,157
  • 30
  • 95
  • 160
  • I think it rather depends on the `pandoc` or even more the `pdflatex` version you use -- eg I've seen this weird spacing issue on Arch Linux but on on Ubuntu using the very same markdown table. – daroczig Apr 20 '16 at 18:13

1 Answers1

1

I had the same problem. Something is wrong with the cell alignment, this error disappeared when i changed style to rmarkdown.

library(data.table)
dt <- data.table(Test = c("0 - 10 000"),
                 ALDT = "99.18 %")

First(space in table):

pandoc.table(dt, justify = c("left", "right"))
# From pandoc below
------------------
   Test     ALDT  
---------- -------
0 - 10 000 99.18 %
------------------

Second(good formatting):

pandoc.table(dt, style = "rmarkdown", justify = c("left", "right"))
# From pandoc below
| Test          |    ALDT |
|:--------------|--------:|
| 0 - 10 000    | 99.18 % |

The first try doesn't work, something is wrong with the formatting pandoc gives us. But if you specify the style as rmarkdown it seems like the formatting is as it should be.

ErrantBard
  • 1,421
  • 1
  • 21
  • 40
  • 1
    FTR this has been fixed in the development version of `pander` around March in https://github.com/Rapporter/pander/pull/254 – daroczig Oct 05 '16 at 15:10