Re: [R] beamer overlays with Sweave?

From: Philipp Pagel <>
Date: Tue, 08 Mar 2011 09:30:38 +0100

> This may be asking too much, but I'm wondering if anyone has a
> solution (even a hack) for creating multiple (overlay) plots in an
> Sweave file and post-processing the overlays in beamer appropriately.

Although I have not done this with beamer and overlays before, I once had to resort to generating the includegraphics commands from within a loop in order to save substantial amoutns of typing. You could do something similar along these lines (untested):


	slidenum <- 1
	plotbasename <- "something"
	plotfilename <- paste(plotbasename, slidenum, ".pdf", sep="")
	cat("\\only", slidenum, "{\includegraphics{", plotfilename ,"}}\n" ,sep="")


	slidenum <- slidenum + 1
	plotfilename <- paste(plotbasenema, slidenum, ".pdf", sep="")
	cat("\\only", slidenum, "{\includegraphics{", plotfilename ,"}}\n" ,sep="")

If you want toget really fancy, you could wrap most of this in a conveniance function...



Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
Maximus-von-Imhof-Forum 3
85354 Freising, Germany

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 08 Mar 2011 - 08:33:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Mar 2011 - 09:00:19 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive