[Rd] library path in Rd link

Duncan Murdoch murdoch at stats.uwo.ca
Thu Nov 15 00:44:13 CET 2007


On 14/11/2007 6:09 PM, Adrian Dusa wrote:
> On Wednesday 14 November 2007, Duncan Murdoch wrote:
>> On 11/14/2007 8:49 AM, Adrian Dusa wrote:
>>> [...]
>>>
>>> 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)?
>> I believe this is normally automatic in platforms other than Windows.
>> On Windows, the answer is no.
> 
> This is what I thought, too. But if I link for example to function anova() in 
> pacakge stats, the html link after installing the new package is:
> 
> file:///home/adi/myRlibrary/stats/html/anova.html
> 
> where the stats package is by default installed in:
> 
> /usr/lib/R/library/
> 
> (indeed my question was related to Windows too, not only on Linux)
> 
> 
>> The problem is that in most cases R isn't in charge of the help file
>> viewing.  There isn't a good way to make a link from an HTML file to a
>> location that isn't known in advance, for example.
>>
>> On Unix-alikes, the workaround is to build soft links to all the
>> packages in a standard location; but soft links don't work on Windows
>> (and we don't want to get into the almost-undocumented hard links that
>> exist on some Windows file systems).
> 
> I understand, thank you. I learned from Prof. Ripley's answer that Windows has 
> link.html.help() function to resolve the html help files from all installed 
> packages.

I didn't know about that; I mainly use the CHMHELP files.  They don't 
support this, being precompiled when the binary package is built. 
Another reason to switch.

The link is probably "../../stats/html/anova.html", and is just being 
displayed by your browser that way.  This is correct:  R installs soft 
links to all packages in one place.  The HTML code doesn't get fixed up 
the way it needs to be on Windows.

Are you browsing the files from outside of R?  As far as I know (and I 
rarely use Unix so this may be out of date info) the links are set up in 
a temporary directoy when you call .libPaths(), and are removed at the 
end of your session.  I don't know if calling library(foo, 
lib.loc="mine") is enough to link the foo help into the system.

Duncan Murdoch



More information about the R-devel mailing list