I'm preparing a beamer presentation using RMarkdown and want to include lm
output in it. However the default size is too large, therefore the output is clipped and can't be seen entirely. How can I change the options to control the size (or font) of R output? I have seen plenty of options regarding size of plots, but none with regards to R output.
Rmarkdown's beamer presentation works with LaTeX
code. To change the output size you can use the corresponding LaTeX
commands, set just before the code junk. The smallest option would be \tiny
. For a full overview consider e.g. this. After the code junk it's important to set back to the size you used before, e.g. \normalsize
.
Example
---
output: beamer_presentation
---
# Regression
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
\tiny
```{r cars, echo = TRUE}
summary(lm(speed ~ dist, cars))
```
\normalsize
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Yielding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With