Skip to content

R command line: need intelligent command history recall?

4 messages · Michael, Philippe GROSJEAN, Brian Ripley +1 more

#
Michael wrote:
Please, submit a bug report to Tinn-R authors, if you want to see it 
improved.
Best,

Philippe Grosjean
#
I guess you are using Windows, as you do not tell us.

History search facilities are available in Rterm.exe, and also in readline 
as used in the interface on Unix-alikes.  Many people use Emacs+ESS.  (In 
all cases I think the search mode is slicker than you describe for 
Matlab.) And RGui has another mechanism (read on) that is more suited to a 
GUI.

If you would like a history search in RGui.exe, please contribute the code 
to do so.  R is a volunteer project, and this was deliberately not 
implemented as no Windows user expressed an interest.

I think you will find `the productivity' is in using a higher-level 
language than C.  R does have a line-by-line debugger (called debug, so 
not hard to find).  If you want to set breakpoints etc, see package 
`debug' on CRAN.  And the `Writing R Extensions' manual in the R-devel 
version of R (to become 2.3.0) has a chapter on `Debugging'.

I teach 50 or so people to use R/S a year.  They end up with different 
patterns of working.  Some use script windows all the time, some use 
Emacs+ESS, some use a Linux command line/Rterm.exe.  I believe it is a 
mistake to think that `one size fits all'.
On Sat, 4 Feb 2006, Michael wrote:

            
Try history().  This pops up a window from which you can submit one or 
more command lines (or parts of lines).
Yes.
That is a matter of opinion.  If you want us to accept your opinion, you 
need to give your credentials, and you haven't even told us your name and 
affiliation.

  
    
#
On 2/4/2006 3:03 AM, Michael wrote:
Writing such a thing is a little tricky, but should be possible if 
someone devotes enough time to it.  A couple of issues are:

  - R source code currently maintains no connection to the file it came 
from.  That would need to be added for a source level debugger.

  - Not all R functions come from source code in a file; they may have 
been entered at the console, produced as the result returned by another 
function, etc.

  - Such IDEs tend to be very platform-specific.  You can do a lot of 
work to make a nice IDE on Windows, and not be able to re-use much of it 
in other platforms.

Currently I don't know of anyone actively working on such a thing.  I 
agree with you that source-level IDEs are great for productivity, and 
I'd probably switch to one if someone else wrote it.  However, I am 
unlikely to ever have time to do the work myself.

Duncan Murdoch