tags:

views:

97

answers:

3

I've never been able to figure out how to get the PgDn/PgUp keys to work in the R Graphics Viewer. Even the demo() programs don't seem to support it. Anyone able to point me to some code that shows how this can be implemented?

Thanks,

Phil

+1  A: 

As I recall you have to turn 'recording' or 'History' on. This is platform-specific and I am not near a Windows machine.

Dirk Eddelbuettel
Thanks to the both of you. I have it working now!
PhilR
Good to know. And you can signal that back to StackOverflow by accepting one of the answers as the official one. I vote for mine :)
Dirk Eddelbuettel
I concur. :)
Shane
Thank you :)
Dirk Eddelbuettel
+4  A: 

Dirk is right.

Another thing to look at are the following functions:

x <- recordPlot()
replayPlot(x)

From the R for Windows FAQ:

The graphics has a history mechanism. As README.R-2.9.2 says:

The History menu allows the recording of plots. When plots have been recorded they can be reviewed by and , saved and replaced. Recording can be turned on automatically (the Recording item on the list) or individual plots can be added (Add or the key). The whole plot history can be saved to or retrieved from an R variable in the global environment. The format of recorded plots may change between R versions. Recorded plots should not be used as a permanent storage format for R plots. There is only one graphics history shared by all the windows devices.

The R console and graphics windows have configuration files stored in the RHOME\etc directory called Rconsole and Rdevga; you can keep personal copies in your HOME directory. They contain comments which should suffice for you to edit them to your preferences. For more details see ?Rconsole. There is a GUI preferences editor invoked from the Edit menu which can be used to edit the file Rconsole.

Shane
A: 

On a mac, one can use the command key with the back arrow (and forward arrow) to cycle through plots.

Make sure you've plotted at least two plots to the same quartz device, then with the plotting window in focus, hit ⌘ ← to see the previous plot.

Peter