[Rd] a hack regarding "No documentation ...."

Mike R mike.rstat at gmail.com
Sun Jun 26 22:56:12 CEST 2005

> ?somecharacters
No documentation for 'somecharacters' in specified packages and libraries:
you could try 'help.search("somecharacters")'

I'm looking for some advice.  I'd like to hack my source code 
in such a way that the empty prompt line above is "pre-filled" 
with the suggested command.  In effect, this would make it 
unnecessary to copy-paste (or type)  

If I did not want to execute the suggested command, I would 
Ctrl-c the pre-filled line.

Alternatively, the hack could implement a query, as in:

> ?somecharacters
No documentation for 'somecharacters' in specified packages and libraries:
you could try:
0 - help.search("somecharacters")
1 - RSiteSearch("somecharacters")
2 -  apropos(somecharacters)
3 - etc .....
<enter> - no action

.... in which case, typing 0, 1, 2, 3, ... and <enter> would issue 
the corresponding command,  or would pre-fill a command line 
with the corresponding command (which could then be edited).

Alternatively, the hack could add the recommended commands to 
the command history, in which case I could use the up/down 
arrows to navigate to them.

I suppose it might be the case that a similar feature is already 
part of R, and that I am just not aware of it.  As a newbie, I spend
most of my time searching/reading documentation.  

Any comments regarding the possible alternatives that I've 
mentioned, or offers of your own alternatives, would be 
appreciated, as would be suggestions or mini-outlines for 
implementing the hack.


More information about the R-devel mailing list