From p.murrell at auckland.ac.nz  Sun Mar 26 22:22:21 2006
From: p.murrell at auckland.ac.nz (Paul Murrell)
Date: Mon, 27 Mar 2006 08:22:21 +1200
Subject: [Rd] [R] RGui: windows-record and command history
In-Reply-To: <4423EE52.2020104@stats.uwo.ca>
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>
	<4423EE52.2020104@stats.uwo.ca>
Message-ID: <4426F7FD.7010305@stat.auckland.ac.nz>

Hi


Duncan Murdoch wrote:
> 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.


Sorry, I came into the discussion a bit late, so there's a good chance I 
have misunderstood.  Within a session, manipulation of .SavedPlots (via 
the appropriate interface) seems reasonable (i.e., manipulations 
involving an entire "page" of output as the basic unit).  Warnings about 
use *between* sessions still apply though.

Paul


> 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

-- 
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
paul at stat.auckland.ac.nz
http://www.stat.auckland.ac.nz/~paul/



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