tags:

views:

85

answers:

1

In R, if we set the help_type argument of help() function to 'html' and call it, it will automatically open the html help in a browser. However, this is not the case for help_type = 'pdf'. Only the pdf is generated. How can I make it automatically after the help file is generated? I believe that pdf help are preferred by some as it can display mathematical formula properly, the html help dont.

+1  A: 

Based on aL3xa comment, under Windows you could use shell.exec to view pdf.

help("plot", help_type="pdf") # help file is saved in working directory
shell.exec(file.path(getwd(), "plot.pdf"))
Marek
I have modified your code to create a function to automate the opening of the pdf help file. I wonder why R does not do that by default.
ggg
Help system in R is changing all the time, I don't be surprised if that option will be available in one of next versions.
Marek