[R] Scripting capabilities for R

Jim Lemon bitwrit at ozemail.com.au
Tue Jun 5 13:37:58 CEST 2001


A bit tardy, perhaps, but here is an NEdit macro for Linux that will
display help
on a selected keyword in an R command file that is being edited.

Select Preferences|Default Settings|Customize menus|Macro menu..
Define a New macro named, for example, R help
Copy the attached macro into the macro editing window at the bottom
Edit the macro by uncommenting the appropriate lines and changing the R
home
directory
Apply the macro
Highlight an R command in the editor and select Macro|R help

You should be able to get either HTML or "text" help in a separate
window.  I
welcome any comments and suggestions.

I have worked out a way to submit selected commands from NEdit to R via
batch
mode, but it is really clunky and I'll refine it to run in the R window
if
possible.  Stay tuned.

Jim
-------------- next part --------------
# NEdit macro to display R help
# NOTE: either change the top search directory to R_HOME
# or create a symbolic link, e.g. /usr/local/R -> /usr/local/R-n.n.n
# this line finds HTML help files
helpfind = "find /usr/local/R/library -name " get_selection() ".html"
# this line finds "text" help files
# helpfind = "find /usr/local/R/library -name " get_selection()
helpfile = shell_command(helpfind," ")
if(helpfile != "") {
# the line below will call KDE's 'kdehelp' to display HTML help
 help_command = "kdehelp " helpfile
# the line below will call 'lynx' in KDE's 'konsole' to display HTML help
# help_command = "konsole -e lynx " helpfile
# the line below will call 'less' in an 'xterm' to display "text" help
# help_command = "xterm -e less " helpfile
 shell_command(help_command," ")
}


More information about the R-help mailing list