Skip to content
Prev 269512 / 398502 Next

Opening package manual from within R

On Tue, 23 Aug 2011, Tyler Rinker wrote:

            
You assume wrong.  Vignettes PDFs are installed as part of the package 
(and often take minutes to regenerate): the PDF version of the help 
pages (what you seem to call 'the package manual') is not (in 
general).  In many cases what other people (including the author, e.g. 
me for RODBC) call the 'package manual' is a PDF in the doc directory 
(which may or may not be a vignette).

The assumption is that people will use search facilities or the hints 
given by the help titles in help(package="tm") or browse the HTML 
version of the same information (e.g. via help.start).

But you can (provided you have pdflatex etc in your path) generate the 
PDF version of the help pages by

R CMD Rd2pdf /path/to/installed/package

It will even open it in a browser for you (unless you use 
--no-preview).  You could easily encapsulate this in a function by 
e.g.

showPDFmanual <- function(package, lib.loc=NULL)
{
     path <- find.package(package, lib.loc)
     system(paste(shQuote(file.path(R.home("bin"), "R")),
                  "CMD", "Rd2pdf",
                  shQuote(path)))
}

Alternatively *for packages on CRAN only* you can access the version 
on CRAN by browseURL.
But accurate 'at a minimum' information (and no HTML) does.  There is 
no such version as '2.14.0 beta', and will not be for a couple of 
months.  If you are running a beta version of R it is old, so please 
update to a released or patched version.   (Also, any version 
calling itself '2.14.0 Under development' is old and needs updating: 
the current R-devel displays no version number.)