[Rd] [patch] add=TRUE in plot.default()

Duncan Murdoch murdoch at stats.uwo.ca
Sun Mar 9 21:04:08 CET 2008


On 09/03/2008 12:46 PM, Andrew Clausen wrote:
> Hi Duncan,
> 
> On Sun, Mar 09, 2008 at 12:11:45PM -0400, Duncan Murdoch wrote:
>> It has never been claimed that it would work, and as far as I can see, 
>> it doesn't make anything easier:  the last line could be replaced by
>>
>> lines(X, f(X), col="red")
>>
>> for more clarity from less typing.  So why would you want add=TRUE in 
>> plot.default?
> 
> I don't like lines() because it ONLY allows you to add to plots.  I could
> send a patch for that too...
> 
> But I also like how plot() is polymorphic.  It's nice how you can do some
> computation -- a regression, a histogram or whatever, and then just call plot()
> on it, and you have a nice graphical representation of it.  But why stop
> there... wouldn't it be nice if you could stack them on top of each other?
> It's often useful to compare things by putting them on top of each other.
> (Are 2 regression lines the same or similar?  Are two utility functions the
> same? etc.)

Part of the reason I didn't like your patch is that it was incomplete: 
it didn't patch the plot.default.Rd file.  That function already has 
around 16 parameters; do we really want to add another one, that 
interacts with some of the ones that are there?

What you really seem to want is to add it to the generic plot(), but 
it's way too late to go modifying that particular generic.

Duncan Murdoch



More information about the R-devel mailing list