[R-SIG-Mac] Confused with default device setup

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Oct 16 16:44:39 CEST 2008


On Thu, 16 Oct 2008, Gang Chen wrote:

> Thanks a lot for the clarifications and helpful information, Prof. Ripley.
>
> A related question along the line: The reason I wanted to have quartz instead 
> of X11 was that quartz() automatically provides antialiasing effect when 
> drawing lines when using dev.new(). I just noticed that on 
> http://developer.r-project.org/blosxom.cgi/R-devel it says "dev.new() gains a 
> '...' argument which can be used to passed named arguments which will be used 
> if appropriate to the device selected". So does it mean I can expect that I 
> could specify an option such as "antialias" in dev.new() in version 2.8.0 so 
> that I would have antialiasing effect in case X11() is invoked?

No.  Antialiasing is the default in the Cairo type on X11 in 2.7.x, but 
you can set it on/off via X11.options().

>
> Thanks again,
> Gang
>
>
> On Oct 15, 2008, at 5:54 PM, Prof Brian Ripley wrote:
>
>> On Wed, 15 Oct 2008, Gang Chen wrote:
>> 
>>> When invoking dev.new() on my Mac OS X 10.4.11, I get an X11 window
>>> instead of quartz which I feel more desirable.  So I'd like to set
>>> the default device to quartz. However I'm confused because of the
>>> following:
>>> 
>>>> Sys.getenv("R_DEFAULT_DEVICE")
>>> R_DEFAULT_DEVICE
>>>        "quartz"
>>> 
>>>> getOption("device")
>>> [1] "X11"
>>> 
>>> What's going on?
>> 
>> I don't know (it is your machine), but here's my guess ....
>> 
>> I dom't see R_DEFAULT_DEVICE set on my Mac, but note that 
>> R_INTERACTIVE_DEVICE takes precedence in interactive use.  So something in 
>> your setup is different from mine, maybe some startup files or R.app 
>> preferences?  The first diagnostic step is to see if R_INTERACTIVE_DEVICE 
>> is set and why R_DEFAULT_DEVICE is set (and see below for why the current 
>> setting is dangerous).
>> 
>>> Also is file Renviron under /Library/Frameworks/R.framework/Resources/
>>> etc/ppc/ the one I should modify if I want to change some environment
>>> variables? But I don't see R_DEFAULT_DEVICE there.
>> 
>> As to where you should set it, it depends on who you want to set it for, 
>> and how you run R (from R.app or from the command line).  But Renviron is 
>> not the right place: a file Renviron.site in that directory would be if you 
>> want a system-wide setting (see ?Startup).  But do be careful, as if you 
>> make quartz the default for remote interactive or batch sessions you are 
>> likely to get undesirable behaviour (possibly even crashes for some R 
>> versions).  In short, don't set R_DEFAULT_DEVICE to an screen device.
>> 
>>> 
>>> TIA,
>>> Gang
>> 
>> -- 
>> Brian D. Ripley,                  ripley at stats.ox.ac.uk
>> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>> University of Oxford,             Tel:  +44 1865 272861 (self)
>> 1 South Parks Road,                     +44 1865 272866 (PA)
>> Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-SIG-Mac mailing list