[Rd] Linking to documentation from a vignette using markdown?

Duncan Murdoch murdoch.duncan at gmail.com
Mon Oct 19 03:18:38 CEST 2015


On 18/10/2015 5:51 PM, Spencer Graves wrote:
> Hello:
> 
> 
>        What's the preferred way to link to package documentation from a 
> vignette using markdown?
> 
> 
>        My current draft includes 
> "[cumsum](https://stat.ethz.ch/R-manual/R-devel/library/base/html/cumsum.html)" 
> to link to the help page for cusum{base} and 
> "[KFAS](https://rweb.crmda.ku.edu/cran/web/packages/KFAS/KFAS.pdf)" to 
> link to the pdf documentation for the KFAS package.  This works, but it 
> feels like an ugly hack, and I wonder if there might be some more 
> elegant way of doing this (documented in a fine manual I have yet to find)?

You can include links that work only when R is displaying the help using
relative URLs like

../../base/help/cumsum

or

../../base/html/cumsum.html

(The former is like doing ?cumsum, i.e. it uses the alias; the latter
goes directly to a page by its name.)

The advantage of this kind of link is it doesn't need an Internet
connection, it works with the R help system; the disadvantage is that it
only works when the help system is running, so those links won't work in
the copy of your vignette on CRAN, for example.

Duncan Murdoch



More information about the R-devel mailing list