Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

panderOptions and xtabs #303

Closed hr70 closed 7 years ago

hr70 commented 7 years ago

Hi, using package pander version 0.6.0, there seems to be an issue with panderOptions and objects of class 'xtabs'.

example: library(pander) panderOptions('decimal.mark', ',') panderOptions('big.mark', '.') dat <- data.frame(x = 1000*(1:4), y = c("A","A","B","B"), z = c("C","D","C","D")) tab <- xtabs(x ~ y + z, data = dat) pander(tab) # not ok - big.mark in effect only for the first column (C) pander(unclass(tab)) # ok for all columns

Regards Henrik

daroczig commented 7 years ago

Hey, thanks for reporting this. Can you please check the dev version installed from GH? Seems to work fine here:

> pander(tab) # not ok - big.mark in effect only for the first column (C)

------------------------
 &nbsp;     C       D   
-------- ------- -------
 **A**    1.000   2.000 

 **B**    3.000   4.000 
------------------------

> pander(unclass(tab)) # ok for all columns

------------------------
 &nbsp;     C       D   
-------- ------- -------
 **A**    1.000   2.000 

 **B**    3.000   4.000 
------------------------

Please reopen if the dev version is still affected