[Rd] [R] RGui: windows-record and command history

Duncan Murdoch murdoch at stats.uwo.ca
Fri Mar 24 14:04:18 CET 2006


I've moved this from r-help to r-devel.

On 3/23/2006 8:17 PM, Paul Murrell wrote:

>> 
>> Paul,
>> If I read your comments correctly, the problem with manipulating the
>> graph history is with saved histories across sessions/versions. Is
>> there any reason not to manipulate it *within* a session? I never
>> save plots for re-use in R. Re-running code is usually best for me.
>> But I would find it handy to fiddle with the display list in a
>> session.
> 
> 
> That is *one* problem with the display list.  Messing directly with the 
> display list *within a session* is *less* dangerous, but R's behaviour 
> if you do that is "undefined".
> 
> The display list is technically an internal structure for R's internal 
> use.  We can't stop you playing with it, but I do not encourage it and 
> it is not officially supported.
> 
> There are a number of simple things that you could do to the display 
> list that should work, but providing proper support for general 
> manipulations of the display list would require a significant amount of 
> (re)design of the R graphics code.
> 
> Paul
> 
> p.s.  These comments apply to the display list in R's "graphics engine". 
>   The 'grid' package also maintains a display list, and that has been 
> designed to support more general manipulations.

Are we talking about the same thing?  I think Peter is only thinking of 
manipulating the .SavedPlots variable, which is a Windows-only object 
holding plot history.  I imagine the entries in .SavedPlots[[5]] are the 
things that you are worried about, and I agree people shouldn't play 
with those, they should be using grid instead with its documented interface.

If we do warn people off manipulating .SavedPlots, then I think it 
should be a higher priority to implement some manipulations ourselves, 
e.g. "[<-.SavedPlots", to allow entries to be moved around or deleted in 
the list.

Duncan



More information about the R-devel mailing list