Pander with label and quotation marks on output

im trying to get a fine 3-way crosstable using ftable with pander. In general, the output is fine, but the row and column names are in quotation marks, which are not perfect.

Example:

library(pander)
varA <-c("a","a","a","a","b","b")
varB <-c(1,2,1,2,1,2)
varC <-c(1,2,3,4,5,6)

tab1<-ftable(table(varA,varB,varC))
pander(tab1)

I'm not sure how I can insert the generated table so that it does not look terrible (copy some strange things into it), but after knitting it looks like in the screenshot below:

enter image description here

Thanks in advance for your help.

+4
source share
1 answer

I think it was a mistake, so thanks for reporting this - hopefully fixed :

> pander(tab1)

---- ---- ---- - - - - - -
          varC 1 2 3 4 5 6

varA varB                 

 a    1        1 0 1 0 0 0

      2        0 1 0 1 0 0

 b    1        0 0 0 0 1 0

      2        0 0 0 0 0 1
---- ---- ---- - - - - - -

enter image description here

, GitHub, , GitHub.

+2

Source: https://habr.com/ru/post/1618708/


All Articles