problem with sub in graphs

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
19 Jun 1998 17:38:38 +0200


Colin Farrow <C.Farrow@geology.gla.ac.uk> writes:

> I understand the problem now. 
> 
> Clearly a more systematic approach to the use of ... is required.
> In the current example with plot and hist the problem arises because parameters 
> of the title function are being passed to other low level graphical functions. 
> The solution therefore is that only global graphical parameters such as col, are 
> passed via ... and function specific parameters like sub need to be specified in 
> the function definition. Hence in the current situation plot.default and 
> hist.default require a sub= argument which should be passed only to the title 
> function. It currently is not, and yes it would be handy to be able to turn off 
> the warnings.

Wait a minute.

Am I the only one sensing that something is badly amiss with that
logic? I agree that that is the essence of the problem, but the
solution seems wrong.

The purpose of '...' is that a function does not be need to know
about certain parameters that are being handled by lower level
routines. It can just pass them along. 

This is very practical for modular programming in that you can just
(e.g.) add an option to a low level function without having to register
it with all other 'upstreams' functions (in different packages and
whatnot). Of course, you still have to be careful about the argument
names but that's fairly easy in practice.

Suppose that a function needs to call *two* such routines. Then why
should it suddenly be made responsible for keeping track of which
arguments make sense to which routine? I'd say that the only sensible
paradigm is that routines that get called with '...' should simply
disregard any arguments they do not understand what to do with.

(I'm also not very happy with the news that S-4 will be enforcing
identical calling sequences for generic methods, but that's another
matter)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._