ggg ggg - 3 months ago 5
HTML Question

Make PDF help files open automatically

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.

Answer

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"))
Comments