Search code examples
rknitrr-markdownbeamer

Rmarkdown / Knitr / Beamer presentation, paginate output


I'm preparing some lecture slides using the rmarkdown / knitr / beamer chain in RStudio. I would like to walk through the output of a summary(fit) call, but the output extends off the slide (even if I make the font size very small as in this answer).

The solution I've come up with is to capture the output of summary as a list, then print those outputs I'm interested in consecutively:

```{r, echo=TRUE, results='hide'}
summary(fit)
```


```{r, echo=FALSE}
out <- summary(fit)
```

```{r, echo=FALSE}
out$call
```

Is there a better way?


Solution

  • Check out the DT package. DT interfaces with the DataTable.Js library enabling print HTML widget datatables with pagination.

    If you aren't viewing the deck from a browser (PDF or .doc) then you can export the plot and embed it in the document as desired - manually or script.