I was wondering whether tikzdevice
package can be used for producing R plots in RMarkdown, to be exported to a beamer presentation.
I would have thought that the solution I am looking for might be similar to the example with Sweave on page 15 of the tikzdevice manual.
What I have tried, without knowing exactly what I am doing, is to amend Yihui's example from the RMarkdown book:
---
title: "Habits"
author: John Doe
date: March 22, 2005
output: beamer_presentation
---
# In the morning
## Getting up
- Turn off alarm
- Get out of bed
---
```{r, echo=FALSE, results='tex'}
require(tikzDevice)
tikz(console=TRUE)
plot(sin, -pi, 2*pi, main="A Stand Alone TikZ Plot")
dummy <- dev.off()
```
Unfortunatly, this does not result in the tikz plot being rendered in the beamer presentation. Does anyone see how this can be achieved? Thanks.
Regards, Michael