Skip to content

X11 with aquamacs

6 messages · stephen sefick, Kasper Daniel Hansen, Ricardo Rodríguez +2 more

#
I have aqua macs installed.  I would like to use this with a R 2.7.2
that I built on os x 10.3.9.  R works fine in the X11 terminal, but I
can not copy and paste ...  I would like to use aquamacs as my
interface to R.  It starts up fine and interfaces with R preforms
computations,  but when i issue the X11() command it does not open up
a window.  I used the command at the x11 terminal as to the aquamacs
FAQ
export DISPLAY=0.0

then I checked to see if aquamacs recognized to use x11 (I don't
remember the exact command right now) and it returned nil.  So, how do
I get aquamacs to interface with x11.

thanks
#
As you can understand from the comments in the /bin/sh: tar thread,  
you cannot expect Aquamacs to pick up environment variables you set  
inside Terminal / xterm.

The - by far - easiest way for you to proceed is to set the  
environment variables inside R using Sys.putenv, and place everything  
in .Rprofile

So do the following:
create ~/.Rprofile with the content

Sys.putenv(DISPLAY = ":0.0")

(I think the colon has to be there, but I may be a bit rusty in my  
DISPLAY syntax, so check out the right syntax online. You can check  
whether it works by doing
Sys.getenv("DISPLAY")
inside of R.)

You need to start the X11 server manually.

You could also have used .Renviron, but (unfortunately) that file is  
not parsed when you execute R CMD BATCH, so personally I don't like  
using it.

Kasper
On Oct 6, 2008, at 9:09 , stephen sefick wrote:

            
#
Kasper Daniel Hansen wrote:
Just my 2 cents: Sys.putenv has been deprecated. Sys.setenv does its 
work without warnings.

Cheers,

Ricardo
8 days later
#
Le lun. 6 oct. ? 12:09, stephen sefick a ?crit :
I'd recommend using the quartz() device instead of the x11() one. The  
display is much nicer and it doesn't require X11. Just put

	options(device = "quartz")

in your ~/.Rprofile file to set it as the default device.

HTH   Vincent
---
   Vincent Goulet, Associate Professor
   ?cole d'actuariat
   Universit? Laval, Qu?bec
   Vincent.Goulet at act.ulaval.ca   http://vgoulet.act.ulaval.ca
#
On Wed, 15 Oct 2008, Vincent Goulet wrote:

            
Better to set env variable R_INTERACTIVE_DEVICE as per the help for 
options(), since you don't want a device that does not work in 
non-interactive sessions.  (It is also better to use 
options(device=grDevices::quartz) to ensure visibility of the device when 
you need it, in case something else has a function quartz).

This is assuming that quartz() actually works on 10.3.9: I didn't think it 
did (in the current incarnation).

  
    
#
quartz does not, but I am very happy with using x11 on 10.3.9-  It is
for tinkering-  when I want to drink some coffee and do a little data
exploration.  I use Sys.setenv(DISPLAY=":0.0") at the start of every
session because I can't seem to get the .Rprofile file to work
correctly.  I have edited my .Rprofile in the home directory, but
indeed it doesn't work (which simply means I don't know what i am
doing).
thanks

Stephen

On Wed, Oct 15, 2008 at 9:51 AM, Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote: