我想使用pander为CrossTable中生成的数字添加逗号。根据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")))
------------------------------------------------
\ t2\ \ \ \
t1 a b c Total
--------- -------- --------- --------- ---------
**a**\ \ \ \ \
N\ 300\ 1200\ 0\ 1500\
Row(%) 20% 80% 0% 60%
**b**\ \ \ \ \
N\ 0\ 0\ 1000\ 1000\
Row(%) 0% 0% 100% 40%
Total 300 1200 1000 2500
------------------------------------------------
关于如何在上述计数中添加逗号的任何想法?感谢