[Rd] \link{} to help pages in Debian

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Dec 1 09:24:52 CET 2004

On Wed, 1 Dec 2004, Iago Mosqueira wrote:

> On Wed, 2004-12-01 at 07:38, Prof Brian Ripley wrote:
>> That's guaranteed by the R install scripts, just by following `Writing R
>> Extensions'.  *If* it is not working for you, you are doing something
>> which you are not telling us.
> Well, I am simply following as much as my, probably limited,
> understanding allows. I am using a stock Debian install, r-base and
> other packages from debian, and extra packages from CRAN. My package
> follows, as far as I can tell, the manual. If I am doing something else
> I am not conscious of it.
>> Ah, but that is not what you actually said (an example of the lack of
>> clarity).
> At least that´s what I tried to do.
>> I still don't know if you are imagining that there might be a problem that
>> you want to write a package to avoid, or that you have a current problem.
> I´ll rather use my imagination for something else. This is a problem
> with my own package, that in fact passes R CMD check.
>> If the latter, please start again with the full details: which packages,
>> the commands you used to install them, what happens and what the links in
>> the html file concerned are.
> Here we go: The package concerned is my own, which passes check fine. I
> include \code{\link{plot.default}} in a help page. After R CMD INSTALL
> this page gets installed in
> /usr/local/lib/R/site-library/mypackage/html/page.html
> and when clicking on the plot.default link, it points to
> /usr/local/lib/R/site-library/graphics/html/plotdefault.html
> instead of
> /usr/lib/R/library/graphics/html/plotdefault.html
> where in fact lives.
> Both locations appear with .libPaths().
> Any other information that can be of help?

I asked for  `what the links in the html file concerned are', so, yes, the 
information I asked for would help.

It should be a relative link like

<code><a href="../../stats/html/optim.html">optim</a></code>

Under Linux, all HTML links are created to the per-session directory and 
not to the original locations.

I think you are expecting to be able to open the installed html file 
directly in a browser and get the links to work.  That's what you have not 
told us you were doing, and you won't find it documented anywhere in the R 
documentation.  (Ironically, it does work under Windows with a separate 
library tree.)

To view R HTML documentation you need to use help.start().  (Otherwise
help(foo, htmlhelp=TRUE) will warn about possible incorrect links.)

Try the documented way

Start R
> help.start()
> help("page")

and the links will be correct, I am pretty sure.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-devel mailing list