Viewing previous graphs in R for Windows |
|
| HOME |
You have produced several plots in R, and now you want to go
back and take a look at one of those old plots. On a Mac or
RStudio, you can do that with the navigation keys. R for Windows
has the same functionality but it is not enabled by default (for
good reasons, see
Warning
below). Here's how to enable it.
Short term fixTo start recording plots, go to the History menu in the graphics window and check Recording. The current plot and plots you do subsequently will be added to the record. You can scroll through recorded plots with the PgUp and PgDn arrow keys. Instead of turning Recording on, you can add individual plots to the record with the History > ADD menu option or with the Insert key.
The plots are recorded in an object called
You can open a graphics window with recording already on
using the command
All of those options require forethought: you need to know that you will want to return to that plot before you obliterate it with the next one. That rarely works for me! I like to change the default behaviour so that recording is on when I do the first plot. Changing the default setting
You can change the default settings of the graphics window
with the
When you open R in future, it will read your .Rprofile file and graphics windows will open with recording enabled. Warning!
The plots are recorded in your workspace in an object called
If you routinely save your workspace when you exit R, then
restore it when you start R again, the
You can check the size with
Don't rely on the plot history as a permanent record of your plots. If you need that, save them as JPG or PDF files with the File > Save as... menu options. |
|
Updated 17 Oct 2016 by Mike Meredith
|
|