[R-SIG-Mac] Help with R on a Mac

Kasper Daniel Hansen khansen at stat.Berkeley.EDU
Sun Apr 16 04:12:53 CEST 2006


 From your description it seems to work: you do just not start R with  
Emacs in this fashion. Emacs is - in my opinion - an extremely good  
editor for use with R, because of the way the help system and other  
things interact with Emacs. However, if you have never used Emacs  
before it will also be along hard road - it takes a _long_ time to be  
familiar with Emacs. Rest assured that you will be (very) frustrated  
at times until you suddenly get it :)

Nevertheless, here is an easy walk through to get R and Emacs to work

1) Download R from CRAN. Install it (while you are at it, remember to  
choose "customize" during installation and install g77 and the tcl/tk  
stuff. This will give you R inside your application folder, which you  
can click on to start. Doing so yields a "standard" R editor.

2) Now you need to install Emacs. There are various versions. I use  
"Carbon" Emacs which is a version of Emacs for Mac which is Unix-like  
in its behaviour. There is also AquaEmacs (google it) which is more  
Mac-centric. I choose Carbon Emacs because I want keyboard shortcuts  
etc. to behave in the same way across platforms - I frequently use  
Unix-like systems. Get Carbon Emacs from here
http://homepage.mac.com/zenitani/emacs-e.html
Install it like any other application. Again you get an application  
you start like any other application.

3) Now it is time to get ESS (Emacs speaks statistics) working. This  
is a package for Emacs which makes Emacs works nicely with R (and  
other stuff). Fortunately, Carbon Emacs comes with ESS installed (you  
may have to install it under AquaEmacs). We just need to activate it.  
In order to do so, use a text editor (eg. Text Edit) to open up a file
   ~/.emacs
(~ = your home directory)
This is your Emacs configuration file. In that file you place the  
following line
(require 'ess-site)
You should now be able to start Emacs without any error messages. If  
you get an error message, you have probably mistyped something.

4) Start up Emacs and type
   M-x R
(you do this by holding either the ALT or the APPLE key down while  
you press x. Then you see "M-x" in Emacs. You type R and return.
You should now see R open up inside emacs. Have fun and type a few  
commands.

5) Finally we need to get graphics working. Open up the file
   ~/.profile
and enter the following line
export DISPLAY=:0.0
You should now be able to plot graphics from the inside of Emacs

Further discussion of ESS/Emacs should be directed at the ESS list.

/Kasper






On Apr 15, 2006, at 5:39 PM, Benjamin Arthur wrote:

> Hello,
> I am having difficulty getting R to work on my Mac OS X 10.4.6  
> powerbook G4
> and also with downloading emacs. I have been able to download the R  
> but when
> I double click the icon I get a page with the copyright info and a few
> commands about license and to quit, etc. Executing the 'help.start()'
> command from that screen, opens another window with manuals,  
> reference, etc.
> Could anyone help me to get R working with the partition screen  
> from emacs
> on my computer? Or does the Mac have a better editor that I could  
> use to
> navigate through R. I will most appreciate that. Thanks!
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list