[R] R command line: need intelligent command history recall?

Duncan Murdoch murdoch at stats.uwo.ca
Sat Feb 4 15:01:47 CET 2006


On 2/4/2006 3:03 AM, Michael wrote:
> Hi all,
> 
> I am not sure if this feature exists in the R-console command line prompt:
> 
> In Matlab, if I want to enter a command which is similar to what I have
> entered before,
> 
> I can enter a few prefix, then press "->", the previous command that matches
> with this prefix will then appear on this command line, and it saves a lot
> of our time.
> 
> For example:
> 
>> abline(lm(new~old))
>> cor(new, old)
> ...
> ...
> ... many lines entered
> ...
> ...
> 
> now I want to reuse "abline(lm(new~old))",
> 
> R-console provides "->" functionality to recall old commands, but it trace
> back one by one, it is slow if "abline" is way back, say 50 lines above my
> current command line... it is too slow.
> 
> In Matlab, I just need to enter "ab", then press "->", if there is no other
> "ab******" between the "abline" and my current command line, then the
> console will intelligently recall "abline" back to me... Very convinient.
> 
> Does this feature exist in R?
> 
> Any other good Integrated Developement Environment for R?
> 
> Perhaps R users are mathematicians and statisticians; but as a software
> engineer myself, I found a Visual C++-like integrated developement
> environment is really efficient and time-saving. It and Borland C++ Builder
> basically sets standard for modern UI design for programming IDEs.
> 
> To be a good IDE, it really needs to have an embedded inline debugger. I've
> asked a statistician, he said he never debugged using a break-point,
> line-by-line execution debugger -- I cannot imagine this. Where is the
> productivity?

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

> 
> I've used Tinn-R. Frankly it is quite creative. It solved the line-by-line
> execution problem by copying the line and pasted it to R-console
> automatically. But a lot of times clipboard generates error. And often times
> the copy and paste within Tinn editor itself are problemetic. For example, I
> have been never able to select a portion of a line. When I paste a
> paragraph, it always erases the current line and the following lines,
> instead of inserting, ...  and if I want to select one line, it always
> select two lines for me... etc.
> 
> Anyway, I hope there is IDEs that are better than Tinn-R.
> 
> Thanks a lot!
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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




More information about the R-help mailing list