1

我想在 CrossTable 中使用 pander 生成的数字添加逗号。根据 pander::pander.CrossTable,可以将选项传递给 pandoc.table,并且有一个名为“big.mark”的选项可以添加逗号。但以下不起作用:

require(pander)
require(descr)
panderOptions("big.mark", ",")
t1<-c(rep("a",1500),rep("b",1000))
t2<-c(rep("b",1200),rep("a",300), rep("c", 1000))
pander(CrossTable(t1,t2, prop.r=TRUE,  prop.c=FALSE, prop.t=FALSE, expected=FALSE, prop.chisq=FALSE, big.mark=panderOptions("big.mark")))

------------------------------------------------
 &nbsp;\    t2\     &nbsp;\   &nbsp;\   &nbsp;\ 
   t1        a         b         c       Total  
--------- -------- --------- --------- ---------
 **a**\   &nbsp;\  &nbsp;\   &nbsp;\   &nbsp;\  
   N\      300\     1200\      0\       1500\   
 Row(%)     20%       80%       0%        60%   

 **b**\   &nbsp;\  &nbsp;\   &nbsp;\   &nbsp;\  
   N\       0\       0\       1000\     1000\   
 Row(%)      0%       0%       100%       40%   

  Total     300      1200      1000      2500   
------------------------------------------------

关于如何在上面的计数中添加逗号的任何想法?谢谢

4

0 回答 0