[R] Scripting capabilities for R

Marc Feldesman feldesmanm at pdx.edu
Wed May 30 17:54:30 CEST 2001


Several folks asked what I had in mind.  This goes a bit beyond the 
capabilities in S-Plus' script window, but here goes:

1)  bracket, brace, parenthesis matching, intelligent indenting
2)  persistent blocks - highlight code, execute code, return to script 
window and have the code still highlighted.
3)  a history that preserves submission sequence line-by-line and 
block-by-block.
4)  code completion for common stuff - this is a wish, not a necessity.
5) simple help from within the window.
6) simple syntax checking within the window
Again, I know that most, if not all, of this is available in some 
combination of Emacs/ESS and/or WinEDt, or can be finessed by keeping some 
other editor minimized (or open) while cutting and pasting back and forth 
between R and the editor.

The "display file" + cut + paste works OK but requires that the file be 
created completely outside R.

Students want the ability to create a window from within R, write a series 
of commands, have them checked by a parser within the script window, be 
able to grab simple help (e.g. the arguments for a particular function), 
and submit snippets ad libitum from the window.  I don't think they need 
the output redirected back to the script window as it is in S-Plus.  As 
long as they can find the output an R window, they'd be fine.  They'd also 
like to be able to have a history file that records the order that a block 
of commands was submitted, not simply the history of each line of code.


Quite apart from the learning/teaching/installing/maintaining end of this 
(I've got students using Linux, Unix, Windows, and 5 different flavors of 
Mac) I just have real difficulty asking students to solve a problem by 
spending more money - either to buy a shareware editor (on top of $150 in 
books for 1 class), or to buy a bigger hard drive to install a svelte 95 MB 
editor (Xemacs) that is at least 5x the size of R itself.   One of the 
beauties of R is that it is really compact and open-source.  It ceases to 
be compact if you have to add Emacs or Xemacs to the equation.  It ceases 
to be open-source if you have to buy something to make it work more 
efficiently.

Again, I'm not at all ungrateful for the incredible amount of work done by 
the whole R team.  I wrote the original email to share some thoughts and 
experiences I had after teaching with both R and S-Plus for 10 weeks.  My 
own work won't be affected by the addition (or non-addition) of a scripting 
window for R, but I think it would make life much simpler for students who 
are learning to use R - especially those who are doing so over a short 
period of time.  Most of these students won't become statisticians or 
mathematicians.  They will probably become consumers who use statistics 
periodically in their work.  I'd like to keep them using R - even if only 
occasionally.  If you don't use R often, it is easy to forget.  If you 
don't use Emacs often, it is nearly impossible to get reacquainted.  Put 
the two together and you have a prescription for - oh slap my face - SPSS!


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list