[R] searching R-help within a function

Uwe Ligges ligges at statistik.uni-dortmund.de
Tue Sep 23 08:30:48 CEST 2003


Olivia Lau wrote:
> Hi,
> 
> I am working on a package which requires separate documentation
> (tutorial documentation, really, with a lot of beautifully
> latexed equations), and does not use R-help.  I am trying to
> make it so that my help function will automatically search
> R-help if the help topic isn't found in my documentation.
> 
> The function looks something like this:
> 
> help.pkg <- function(topic) {            # where the topic is a
> character string
>     url <- NULL
>     if(is.character(topic)) {
>         .....   # assignments for the URL given the topic
>        }
>     if (is.null(url)) {
>         topic <- as.name(topic)
>         help(topic)
>    }
> }
> 
> In the last line, help(topic) returns that there is no help for
> "topic".  I have also tried various permutations of
> substitute(help(topic)) and eval() to no avail.

     do.call("help", list(topic))

Uwe Ligges

> Any suggestions are greatly appreciated.  Thanks,
> 
> Olivia Lau.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list