[R] customizing help()

Prof Brian D Ripley ripley at stats.ox.ac.uk
Tue Apr 4 13:10:41 CEST 2000

On Tue, 4 Apr 2000, Kurt Gerber wrote:

> Hi
> I tried to customize help(), so it starts the compiled html help, and
> searches in all packages.
> I wrote the following function:
>  > my.help
> function(topic){
> help(topic, package=.packages(all=T), lib.loc=.lib.loc, chmhelp=T)
> }
> When I use it with
> >my.help(help)
> give the following error:
> Error in help(topic, package = .packages(all = T), lib.loc = .lib.loc,  :
>         No documentation for `topic'
> I tried also with
> > my.help
> function(x){
> help(x,chmhelp)}
> with the same result.
> Only doing help(help) is working. Why my function doesn't work?

Because the first argument of help() is handled specially, to allow
help(help) or help("help").  my.help(help) passes the help object to help,
not "help".  But my.help("help") will still fail.

I could tell you how to do this, but I do think it is a bad idea, and
we worked quite hard to do something better in 1.0.0.  The problem is that
those options will find a copy of the help under a given name, and quite
possibly not help for the object in the packages you have loaded.

You can set the preference for chmhelp via an options setting.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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