I am trying to generate reports with knitr and pander.To display row- or column-percentages in a table I would like to use the CrossTable()
function and get rid of values of Chi-square contribution and the table total.
Here is an example:
```{r}
x <- c(1,1,2,2)
y <- c(1,2,1,2)
CrossTable(x, y, prop.chisq=FALSE, prop.t = FALSE)
works quite well but
pander(descr::CrossTable(x, y, prop.chisq=FALSE, prop.t = FALSE), split.table = Inf)
```
results in an error message:
Quitting from lines 45-78 (test.Rmd) Fehler in apply(x$prop.tbl, c(1, 2), to.percent): dim(X) must have a positive length Calls: ... eval -> eval -> pander -> pander.CrossTable -> apply
How can I produce a table with only row- and column-percentages using pander
and CrossTable
?
Kind regards, Maller
This has been fixed in the development version of
pander
with a recent commit: