[R] printing html help to the terminal

Michael Lachmann lachmann at eva.mpg.de
Wed Aug 4 20:40:40 CEST 2010


I just tried it under OSX and linux, and both get stuck. Maybe R on windows
forks the R help server?

But what you suggested works perfectly. Thanks!

Do you by chance know if there was something equivalent in R 2.10.x and/or
2.9.x


Duncan Murdoch-2 wrote:
> 
> On 04/08/2010 12:44 PM, Michael Lachmann wrote:
>> I'm trying to get help to print the help pages in html format to the
>> terminal. This is in order to be able to see the html help files
>> remotely.
>>
>> If I do
>> printURL = function(file) {a=readLines(url(file));cat(a,sep="\n")}
>> options(browser=printURL)
>> options(help_type="html")
>>
>> then invoking help with
>> ?print
>>
>> gets stuck. I think what happens is that the web server run by R that
>> allows
>> one to read help will not work as long as R is waiting for the function
>> to
>> complete. Thus, if I run a second R session, and try to read the help
>> files
>> that one session produces from the other, I have no problems.
>>
>> I also tried
>> options(browser="wget -O- ")
>>
>> But again, while R is waiting for the command to complete, the web server
>> is
>> dead.
>>
>> Is there a better way to accomplish this?
>>
>>   
> 
> What you're doing should work, and it works for me in 2.11.1 in 
> Windows.  Not sure why it doesn't work for you.
> 
> A more direct way to get the HTML output for a help file is to use the 
> internal utilities that R uses.  You get the help page using
> 
> page <- utils:::.getHelpFile(?print)
> 
> (remember to keep that question mark!), and use
> 
> tools::Rd2HTML(page)
> 
> to turn it into HTML.
> 
> 
> Duncan Murdoch
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
-- 
View this message in context: http://r.789695.n4.nabble.com/printing-html-help-to-the-terminal-tp2313801p2313983.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list