Re: [Rd] library path in Rd link

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Wed, 14 Nov 2007 18:44:13 -0500

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



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 14 Nov 2007 - 23:46:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 15 Nov 2007 - 00:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.