From murdoch at stats.uwo.ca  Fri Mar 24 14:04:18 2006
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Fri, 24 Mar 2006 08:04:18 -0500
Subject: [Rd] [R] RGui: windows-record and command history
In-Reply-To: <442348BC.3080707@stat.auckland.ac.nz>
References: <d0f55a670603230435t6a4b7a59h@mail.gmail.com>		<4422A744.50209@stats.uwo.ca>		<971536df0603230729t4828a082o26f5905b50226250@mail.gmail.com>		<4422C1A3.5050509@stats.uwo.ca>	<971536df0603230746r1ef31624qea7ffb5e8f015c67@mail.gmail.com>	<4422DCED.9040005@stats.uwo.ca>	<4422FA3F.5060001@stat.auckland.ac.nz>	<4423424F.20407@math.ucalgary.ca>
	<442348BC.3080707@stat.auckland.ac.nz>
Message-ID: <4423EE52.2020104@stats.uwo.ca>

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



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