From tlumley at u.washington.edu  Thu Nov 18 01:18:11 2004
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Thu Nov 18 01:18:37 2004
Subject: [Rd] Re: [R] changing (core) function argument defaults?
In-Reply-To: <BAY22-F8BBB2BB7E3C5D182A17A0A7C20@phx.gbl>
References: <BAY22-F8BBB2BB7E3C5D182A17A0A7C20@phx.gbl>
Message-ID: <Pine.A41.4.61b.0411171613130.86544@homer12.u.washington.edu>


Restricted to r-devel (it is almost never appropriate to send the same 
message to both lists).

On Thu, 18 Nov 2004, RenE J.V. Bertin wrote:
> &gt;From: Patrick Connolly &lt;p.connolly@hortresearch.co.nz&gt;
> &gt;To: &quot;RenE J.V. Bertin&quot; &lt;rjvbertin@hotmail.com&gt;
> &gt;Subject: Re: [R] changing (core) function argument defaults?
> &gt;Date: Thu, 18 Nov 2004 11:43:10 +1300
>
> &gt;
> &gt;On Wed, 20-Oct-2004 at 07:48PM +0200, RenE J.V. Bertin wrote:
> &gt;
> &gt;|&gt; Hello,
> &gt;|&gt;
> &gt;
> &gt;|&gt; Is it possible to change the defaults for the arguments to a
> &gt;|&gt; function, without changing the function code itself?  I'm asking
> &gt;|&gt; because I'd like to override the default dimensions and font family
> &gt;|&gt; for a graphics device. Before 2.0.0, I'd just do that with a small
> &gt;|&gt; edit in the appropriate .R file containing the device function
> &gt;|&gt; definition. I appears to be possible no longer. So rather than
> &gt;|&gt; copying the definition into my own .Rprofile, it would be nice if
> &gt;|&gt; just the defaults could be modified...
> &gt;
> &gt;I didn't notice a response to this question.  I'd like to do something
> &gt;similar and haven't been able to work out how to do it.

You can write a wrapper

X11<-function(display="",width=2,height=2,...){
    grDevices::X11(display,width,height,...)
}

and put that into your Rprofile.

 	-thomas


[Rd] Re: [R] changing (core) function argument defaults?
Thomas Lumley