[R] Is it possible to open a specific file in the HTML browser like help(htmlhelp=TRUE) does?

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Thu Mar 7 20:46:49 CET 2002

On Thu, 7 Mar 2002, Henrik Bengtsson wrote:

> Dear all/anyone, after generating a HTML file "result.html" from within [R],
> I would like to open the default HTML browser (like help.start() does) to
> show the file. Is it possible to do this (without trying to do a system
> dependent search for possible browsers)? I browsed the source of package
> 'base' (R v1.4.1 WinMe) and I found the following in help():

(Browsing the help files might be more use.)

>    .Internal(show.help.item(file, 1, ""))
> but I couldn't get it to load "result.html", which is in the current
> directory and also, since it is not documented I don't know if this is a
> cross-platform function or even safe to use.

In Windows, use shell.exec("result.html"), which is documented.  (It looks
like `file' needs to be an absolute path, e.g. "c:/R/result.html".)

There is no cross-platform way that we know of. On Unix help.start uses a
system() call to launch netscape.

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