[ESS] [R] ESS and Emacs
Kasper Daniel Hansen
khansen at stat.Berkeley.EDU
Sat Dec 31 15:57:46 CET 2005
I have written up a short guide to installing ESS with GNU Emacs
under MS Windows. I will wait a bit for feedback and then post it to
the list and on my webpage.
/Kasper
Installation of ESS+Emacs under Windows
=======================================
## Versions ##
Last updated 2005-12-31 using ESS 5.2.11, R-2.2.1 and a danish version
of Windows 2000.
## Some background ##
There are two different releases of Emacs: GNU Emacs and
Xemacs. Until recently Xemacs came with a large bundle of packages as
well as a windows installer, meaning it was relatively easy to install
for an Emacs newbie. On the other hand, updating the ESS package for
Xemacs was harder than doing it for GNU Emacs.
Recent posts on the ESS mailing list have indicated that Xemacs no
longer ships with ESS.
## Installing GNU Emacs ##
Get the newest release of GNU Emacs for Windows from
[gnu-emacs](http://ftp.gnu.org/gnu/windows/emacs)
There are several files in this location. I have been using
`emacs-21.3-bin-fullbin-i386.tar.gz`
Download the file and extract it. Any reasonable zip utility for
Windows ought to handle `.tar.gz` files. I suggest extracting the
files to a temporary directory. This directory will now contain
`emacs-21.3` with the subdirctories `bin`, `lisp`, `etc`, `doc`,
`site-lisp` Copy the `emacs-21.3` directory to the place you want to
install Emacs, I suggest `C:\Program Files`. Then run the program
`emacs-21.3/bin/addpm.exe`, which will add Emacs to your start
menu. You may want to add a shortcut to `emacs-21.3/bin/runemacs.exe`
to your desktop and/or quicklaunch bar.
Emacs is now installed.
## The HOME directory and .emacs ##
Emacs is configured either using a local or a global configuration
file. Unless you are a sys admin installing a multiuser system, the
local configuration file will be sufficient. On Windows that file is
called `_emacs` and the default location is `C:\` or where the HOME
environment variable is pointing to. In Emacs documentation that file
is referred to as .emacs (dot-emacs).
Depending on your system it may or may not be useful to setup your
HOME variable properly. The advantages are that it allows for
different .emacs files for different users (of course irrelevant for a
single user system) and that the ~ character expands to the HOME
directory, as *NIX users may be used to.
Setting the HOME is different depending on what version of Windows you
are running. On Windows 2000 you right-click on "My Computer", select
properties -> advanced -> environment variables, and then create a
variable called HOME pointing to the relevant home directory.
## Installing ESS ##
Download the latest version of ESS from
[ess.r-project.org](http://ess.r-project.org)
This comes in form of either a tar.gz or a .zip archive (there are no
differences between the two archives). Extract the contents of the
archive into `emacs-21.3/site-lisp`. That will create the directory
`emacs-21.3/site-lisp/ess-5.2.11`.
We now need to load ESS. This is done by placing the following command
in the .emacs file:
(load "C:/Progra~1/emacs-21.3/site-lisp/ess-5.2.11/lisp/ess-
site.el")
You can test whether it works by starting up Emacs and do
C-x C-f test.R
This should open up a buffer with an R script called test.R. If the
loading was done succesfully you should see something
like `(ESS[S] [none])` in the second to last line of the Emacs window.
## Making sure that inferior-R mode works ##
Try to start R from within Emacs by executing
M-x R
My experience is that this does not work out of the box with ESS
5.2.11. In that case Emacs will say somethng like "Unable to locate
Rterm.exe". In that case, add the following to your .emacs
(setq inferior-R-program-name "C:/progra~1/R/R-2.2.1/bin/
Rterm.exe")
******************
On Dec 31, 2005, at 12:58 AM, Kasper Daniel Hansen wrote:
> If you are indifferent as to whether you are using GNU Emacs or
> Xemacs you might want to use GNU Emacs. I used that some time ago and
> it worked without problems. You will have to install ESS manually as
> Tony described. Since I am currently at a house with a windows
> computer I might even try to do it tomorrow to give you a bit more
> specific info.
>
> /Kasper
>
> On Dec 31, 2005, at 12:41 AM, Mark Leeds wrote:
>
>>
>> I found a sample.init.el file
>> that I renamed as Rinit.el and put in my
>> .emacs directory but I STILL get that "xargs" error
>> after a little loading.
>>
>> Would someone that use ESS and Emacs
>> Together on windows mind sending me their init.el file
>> And, if that doesn't work, I'll give up
>> and just tell myself that
>> I gave it my best shot.
>>
>> Thanks
>>
>> -----Original Message-----
>> From: Mark Leeds
>> Sent: Friday, December 30, 2005 5:31 PM
>> To: A.J. Rossini
>> Cc: ess-help at stat.math.ethz.ch
>> Subject: Re: [ESS] [R] ESS and Emacs
>>
>> Hi Mr. Rossini : I took
>> the liberties of putting
>> the load command inside
>> my Rinit.el file and have Rinit.el as
>> the target of my Xemacs icon ( see John
>> Fox directions for how to do that ).
>>
>> Things definitely happen which is
>> a good sign that I never had before but they go
>> so fast on the bottom of the emacs page
>> ( I think one of them is "loading cus-face"
>> but I can't be sure. I've
>> tried running it atleast 20 times to
>> see if I can see what it says but I can't )
>> but then , after about a second or
>> two of loading stuff, it gives an error :
>>
>> "Searching for program : No such file
>> or directory, xargs".
>>
>> Given that I don't know Lisp, maybe
>> I should give up unless this error
>> means anything to you or anyone else.
>> Basically, I can't tell where
>> it's bombing because I have no clue about
>> Lisp. Thanks.
>>
>> Mark
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: A.J. Rossini [mailto:blindglobe at gmail.com]
>> Sent: Friday, December 30, 2005 11:37 AM
>> To: John Fox
>> Cc: R-Stat Help; Mark Leeds; ESS-help at stat.math.ethz.ch
>> Subject: Re: [R] [ESS] ESS and Emacs
>>
>> Whoops, sorry John. In the last few months, we took off the XEmacs
>> packaged ESS since it wasn't keeping up very well with the tarball,
>> due to complications, mis-matched release schedules/requirements, and
>> the like.
>>
>> It now needs to be installed from tarball, though there is some help
>> for that, I believe. (someone remind me what it is!).
>>
>> On 12/30/05, John Fox <jfox at mcmaster.ca> wrote:
>>> Dear Paul and Mark,
>>>
>>> I've just taken a look at the current XEmacs setup program for
>> Windows, and
>>> it has changed significantly since the document to which you
>>> referred
>> was
>>> last updated (about a year ago). In particular, the XEmacs setup no
>> longer
>>> gives you the option to install all packages, as I recommended.
>>> Among
>> these
>>> is ess, which is not in the small set of packages that XEmacs
>> currently
>>> installs, nor does ess seem to be available via the packages tool in
>> XEmacs.
>>>
>>>
>>> I'm copying this response to the ESS help list, and will remove the
>>> XEmacs/ESS document on my web site so that people aren't further
>> misled.
>>>
>>> Sorry for the problem,
>>> John
>>>
>>> --------------------------------
>>> John Fox
>>> Department of Sociology
>>> McMaster University
>>> Hamilton, Ontario
>>> Canada L8S 4M4
>>> 905-525-9140x23604
>>> http://socserv.mcmaster.ca/jfox
>>> --------------------------------
>>>
>>>> -----Original Message-----
>>>> From: r-help-bounces at stat.math.ethz.ch
>>>> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of paul
>>>> sorenson
>>>> Sent: Thursday, December 29, 2005 11:51 PM
>>>> To: Mark Leeds
>>>> Cc: R-Stat Help
>>>> Subject: Re: [R] ESS and Emacs
>>>>
>>>> I tried it with XEmacs on Win XP and I had to install ESS
>> separately.
>>>>
>>>> Mark Leeds wrote:
>>>>> I have been using the document written by John Fox titled Sn
>>>>> Introduction to ESS + XEmacs for Windows Users of R.
>>>>>
>>>>> It's a very nice document and
>>>>> I went through it carefully but I got
>>>>> an error when I finished it and launched XEmacs.
>>>>>
>>>>> The error is "cannot open load file : ess-site".
>>>>>
>>>>> So, I did more investigation
>>>>> and it seems like there is a folder
>>>>>
>>>>> Program Files/XEmacs/xemacs-packages/etc/ess
>>>>>
>>>>> that should have been created when
>>>>> I downloaded XEmacs but it doesn't exist.
>>>>> There is a folder called efs ( rather than ess ) but I don't think
>>>>> that's it.
>>>>>
>>>>> I tried installing XEmacs again but the same thing happened.
>>>>>
>>>>> Does anyone know anything about this ?
>>>>> I am using Windows NT.
>>>>> Thanks.
>>>>>
>>>>> Mark
>>>>>
>>>>>
>>>>>
>>>>
>> *********************************************************************
>> *
>>>>> This email and any files transmitted with it are
>>>>> confidentia...{{dropped}}
>>>>>
>>>>> ______________________________________________
>>>>> R-help at stat.math.ethz.ch mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>> PLEASE do read the posting guide!
>>>>> http://www.R-project.org/posting-guide.html
>>>>>
>>>>
>>>> ______________________________________________
>>>> R-help at stat.math.ethz.ch mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide!
>>>> http://www.R-project.org/posting-guide.html
>>>
>>> ______________________________________________
>>> ESS-help at stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/ess-help
>>>
>>
>>
>> --
>> best,
>> -tony
>>
>> blindglobe at gmail.com
>> Muttenz, Switzerland.
>> "Commit early,commit often, and commit in a repository from which
>> we can
>> easily
>> roll-back your mistakes" (AJR, 4Jan05).
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>>
>>
>> *********************************************************************
>> *
>> This email and any files transmitted with it are
>> confidentia...{{dropped}}
>>
>> ______________________________________________
>> ESS-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>>
>>
>> *********************************************************************
>> *
>> This email and any files transmitted with it are confidentia...
>> {{dropped}}
>>
>> ______________________________________________
>> ESS-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
More information about the ESS-help
mailing list