[Rd] library path in Rd link

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Nov 14 22:47:08 CET 2007


On Wed, 14 Nov 2007, Adrian Dusa wrote:

>
> Dear all,
>
> When creating new functions in a package, there is a "See also" component in
> the Rd file.
> Usually one uses \link{otherfun}, if the other function is from the same
> package, or \link[otherpackage]{otherfun} otherwise.

I think you have misread the manual here:

   There are two other forms of optional argument specified as
   \link[pkg]{foo} and \link[pkg:bar]{foo} to link to the package pkg, to
   files foo.html and bar.html respectively. These are rarely needed,
   perhaps to refer to not-yet-installed packages (but there the HTML
   help system will resolve the link at run time) or in the normally
   undesirable event that more than one package offers help on a topic
   (in which case the present package has precedence so this is only
   needed to refer to other packages)

Note: 'rarely needed'.

> The trouble is that I install new packages not in the default R library
> folder, but into some other subfolder in my home, so the link searches
> for "otherpackage" in my home subfolder.
>
> Is there a method to create links to functions from the base package, for
> example (which is installed by default in the normal library folder)?

What OS is this?  (As I recall you used Linux last time you posted.)

In any case, on all OSes you will be able to do cross-library links to the 
base package without having to do anything further (and CRAN packages are 
full of them).  On Unix-alikes the help files are all linked into a single 
virtual library, and on Windows links to the base package (and a few 
others) from other libraries are fixed up on installation by 
link.html.help (see its help).

-- 
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