[R] Link to a pdf document

Duncan Murdoch murdoch.duncan at gmail.com
Tue Jun 29 12:43:34 CEST 2010


cgenolin wrote:
> Hi the list,
>
> I would like to put a link in a .Rd file to a PDF document (not a vignette,
> just a
> regular PDF). I put my PDF in the folder inst/doc/toto.pdf. In the bible
> "2.5
> Cross-references", I read that \link can point to PDF file, but I did not
> manage to do
> it. How shall I do that ?

I think you misread the documentation.  What it says is that links will 
be produced in PDF documents (i.e. the PDF form of the man pages), but 
those are internal links.

You can use the \url tag (or as of the upcoming 2.12.0 the \href tag) to 
link to a PDF file.  If your package is named "foo",  
\url{/library/foo/doc/toto.pdf} should work.  (The "/library/" part at 
the start does not need to match your own library location; the help 
server looks for that particular string.)

Duncan Murdoch



More information about the R-help mailing list