Henrik Bengtsson
2002-Mar-07 19:07 UTC
[R] Is it possible to open a specific file in the HTML browser like help(htmlhelp=TRUE) does?
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(): .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. Suggestions? Henrik Bengtsson Dept. of Mathematical Statistics @ Centre for Mathematical Sciences Lund Institute of Technology/Lund University, Sweden (+2h UTC) Office: P316, +46 46 222 9611 (phone), +46 46 222 4623 (fax) h b @ m a t h s . l t h . s e, http://www.maths.lth.se/bioinformatics/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ripley@stats.ox.ac.uk
2002-Mar-07 19:46 UTC
[R] Is it possible to open a specific file in the HTML browser like help(htmlhelp=TRUE) does?
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Zed Shaw
2002-Mar-08 05:22 UTC
[R] Is it possible to open a specific file in the HTML browser like help(htmlhelp=TRUE) does?
Henrik, I have actually just started a function in the report writing library I'm working on which does this. All I really did was rip off code from help.start. The key part is the system call at the bottom of the function. Problem is, this is not portable (as others have mentioned). If you come across a better way of doing this, let me know. Zed A. Shaw On Thu, 2002-03-07 at 11:07, 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(): > > .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. > > Suggestions? > > Henrik Bengtsson > > Dept. of Mathematical Statistics @ Centre for Mathematical Sciences > Lund Institute of Technology/Lund University, Sweden (+2h UTC) > Office: P316, +46 46 222 9611 (phone), +46 46 222 4623 (fax) > h b @ m a t h s . l t h . s e, http://www.maths.lth.se/bioinformatics/ > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._