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

Duncan Murdoch murdoch.duncan at gmail.com
Mon Oct 19 12:08:14 CEST 2015


On 18/10/2015 10:12 PM, Spencer Graves wrote:
> Hi, Duncan:
> 
> 
> On 10/18/2015 8:18 PM, Duncan Murdoch wrote:
>> 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.
> 
> 
>        Thanks.  I think I saw links like these reading html trying to 
> find what I needed for [KFAS];  this helps me understand what I read.  I 
> think I'd prefer having links that work in a pdf that I could pass to 
> someone who may not have R installed.
> 
> 
>        What's the easiest way to find links like the absolute web 
> address I gave for [KFAS]?  It took me a couple of hours, because I 
> couldn't find how to get more than "https://rweb.crmda.ku.edu/cran/" 
> from any of my current web browsers (Safari, Chrome, and SeaMonkey on OS 
> X 10.11, Internet Explorer, Chrome, FireFox and SeaMonkey under Windows 7).
> 

CRAN uses frames, so the displayed address is the outer frame, but
different parts of the display come from different pages, which is why
the address bar doesn't change.  But you can still find the real link.
In Firefox you right click on the link and choose "Copy Link Location".
 I assume other browsers have similar methods.

BTW, I'd recommend using the "Cloud" mirror; it will be fastest for the
majority of users, not just those near ku.edu.

Duncan Murdoch



More information about the R-devel mailing list