If you want to use several different tools, it is very comfortable with Sweave, and LaTeXthe document class beamerfor the slide:
\documentclass{beamer}
\title{Sequential Graphs}
\begin{document}
\frame{\titlepage}
\frame{
Here a graph:
<<echo = FALSE,fig = TRUE>>=
library(ggplot2)
d1 <- data.frame(x = 1:20, y = runif(20),grp = rep(letters[1:2],each = 10))
p <- ggplot(data = d1, aes(x = x, y = y)) + geom_point()
print(p)
@
}
\frame{
Here the next graph:
<<echo = FALSE,fig = TRUE>>=
p <- p +geom_line(aes(group = 1))
print(p)
@
}
\frame{
Here the last graph:
<<echo = FALSE,fig = TRUE>>=
p <- p +geom_point(aes(colour = grp))
print(p)
@
}
\end{document}
I used ggplothere because it has convenient syntax for adding elements to the chart, but this should work with any other graphical method in R, I would think.
source
share