[ESS] 2 things I wish ESS would do

Dr. Alun Pope AlunPope at rismark.com.au
Thu May 1 01:49:19 CEST 2008

Agree with all your sentiments, Paul, especially the reasons for using
Emacs and ESS and R and Latex (and Rweave) and thanks for the helpful
work-arounds etc from the other guys.  


Alun Pope
Research Manager
Rismark International


-----Original Message-----
From: ess-help-bounces at stat.math.ethz.ch
[mailto:ess-help-bounces at stat.math.ethz.ch] On Behalf Of Paul Johnson
Sent: Thursday, 1 May 2008 1:57 AM
To: ess-help
Subject: [ESS] 2 things I wish ESS would do

I have 2 requests/suggestion. These reflect my experience trying to
teach students to use R with Emacs.

1. I asked for this before, some of you said it was unnecessary for
you.  OK.  I still  wish the command history would interleave commands
sent from the ESS script file and commands typed at the command
prompt.  Since some of you don't want that, I don't want that imposed
on everybody.  But can it please be an option?  In the past, some
other users said they would like this, but we were shouted down by
others who said "just go read your script file if you want to see what
you did." But that really does not help.

Here's why.  In "actual practice" this is how we use Emacs, ESS and R.
 We open a file "blob.R" (or whatever) and we type whatever commands
we want in there, and send them to the *R* session in a separate
buffer.  Suppose we get errors in the *R* buffer.  We'd like to go
there, recall the failed commands, and test changes.  After we fix
errors, we are not sure what we want to do.  So we go over to the *R*
buffer and start typing stuff in, testing commands, and such.  Maybe a
student will make a mistake, accidentally destroy some data or such.
It is very irritating that the command history you get with Control-up
does not show all commands that have been executed.  It makes it
harder to experiment, especially when students are trying to see "what
works."  If we could Control-up to go backwards to find commands that
came from the script file as well as from the *R* buffer, life would
be so much happier.

Of course, nobody who knows everything about R would need that
function.  That's why I don't want it imposed on you.  I just want it
for me & mine.

2. Can you make it easier to transfer commands that work from the *R*
window back to the script file "blob.R" ?  Once we do hack our way to
success in the *R* file, we want to get those commands back and save
them.  At the current time, the only way I can find is to highlight
the whole section of the *R* buffer, copy it over to "blob.R" and then
delete all the lines that don't start with > and edit the rest.

It would be really handy if there were some way to transfer the
previous ten (or so)  commands from the *R* buffer back to the
insertion point in blob.R.

Or, how about click in a line in *R* and press a button to copy
command back to script file?

Again, I understand that people who know perfectly well what they are
doing do not need features of this sort.  However, the people who are
learning to use R need a little more consideration.

I suppose you are thinking, "if your people don't know R, why are you
bothering with Emacs-ESS?"  I'm endorsing Emacs because it is the only
editor I know of that you can get for all platforms and I expect it
will be maintained over the long term (because so many smart
programmers use it). If we can teach students to use Emacs, they will
have an editor that they can use if they want to learn to program in
C, Java, LaTeX, or whatever else.  So, although Emacs is sometimes
inconvenient in the short run, I expect it is beneficial in the long
run.  Some of my Windows/Mac colleagues are endorsing an editor called
"TINN-R" for students, or WinEdt.  I'm a conscientious objector on
platform-limited editors...


Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

ESS-help at stat.math.ethz.ch mailing list

More information about the ESS-help mailing list