2

When working in a RMarkdown file, I end up needing to call %>% pander after each statement I want to show in order to get the results to be displayed in the nice format that pander creates.

Is there any way to get RMarkdown / knitr to automatically send all of the results to pander in order to determine how it should print them?

```{r}
# default output looks bad
USJudgeRatings
```

```{r}
library(magrittr)
library(pander)

# With pander it looks much nicer
panderOptions('table.split.table', Inf)
USJudgeRatings %>% pander
```

enter image description here enter image description here

Rob Donnelly
  • 2,256
  • 2
  • 20
  • 29
  • That was the original goal of the `pander` package, to automatically transform R objects into markdown :) See eg the [Brew to Pandoc](http://rapporter.github.io/pander/#brew-to-pandoc) section in the documentation, which describes a literate programming framework similar to `knitr` to achieve this goal. But this is also possible with `knitr` and `rmarkdown`, I think you need to tweak the hooks described at http://yihui.name/knitr/hooks/ – daroczig Nov 17 '15 at 08:53

0 Answers0