[Rd] use of depends, suggests, etc

Duncan Murdoch murdoch.duncan at gmail.com
Sat Jan 29 21:57:54 CET 2011

On 11-01-28 12:18 PM, Kevin R. Coombes wrote:
> The situation I am talking about is essentially the one in your example.
> If package [Bar] is not installed on the machine where R CMD chedk is
> running, then putting
>       Suggests: Bar
> in the DESCRIPTION file causes R CMD check to fail, with the error message
>       * checking package dependencies ... ERROR
>       Package required but not available: Bar
> Thus, for purposes of running R CMD check, anything listed in Depends,
> Suggest, or Imports is required to be installed.
> However, I'd like to be able to talk about the package in the Rd file
> (even if it is not installed locally), and have a link generated (which
> will only work if the package is installed), but not actually use or
> require package Bar for anything in my own package.

You can probably avoid the check problems by using a link generated
at display time by \Sexpr, with code that generates a link if the target 
is installed, and plain text if not.  Seems like it would be overkill, 
but you must have good reasons to want to link to packages that don't 
exist on the test machines, so maybe it's worth doing.

Duncan Murdoch

>       Kevin
> On 1/27/2011 4:31 PM, Ken.Williams at thomsonreuters.com wrote:
>> But suppose I want to write something like: "this package is 10 million
>> times better than my other package [Foo] because that one will eat your
>> children" - or "in contrast to the package [Bar], this package is for
>> continuous data, while that one is for discrete data, so they don't
>> interoperate".
>> It wouldn't make sense to Depend or Suggest or Import the [Foo] or [Bar]
>> package, but if I didn't, the doc-building process will (apparently - I
>> haven't tried it myself) warn about the link being broken.
>> I can think of several different ways to address this if there isn't an
>> existing way (e.g. create a generic SeeAlso dependency field; use a
>> different syntax for citing packages that aren't dependencies of one sort
>> or another, etc.), but obviously they'd need the blessing of the people
>> maintaining the tools&   specs.
>> --
>> Ken Williams
>> Senior Research Scientist
>> Thomson Reuters
>> Phone: 651-848-7712
>> ken.williams at thomsonreuters.com
>> http://labs.thomsonreuters.com
>> On 1/27/11 4:12 PM, "Prof Brian Ripley"<ripley at stats.ox.ac.uk>   wrote:
>>> On Thu, 27 Jan 2011, Kevin R. Coombes wrote:
>>>> Hi,
>>>> I'm putting together an R package.  In explaining how it works (in the
>>>> Rd
>>>> files), I want to refer to another package.  The other package is not
>>>> used
>>>> anywhere in the actual code nor in the examples. So, there is no reason
>>>> to
>>>> include the other package in the Depends, Suggests, or Imports lines of
>>>> the
>>>> DESCRIPTION file.  People will be able to use my package without
>>>> actually
>>>> installing the other package.
>>>> However, "R CMD check" warns about "Missing link(s)" when it is
>>>> checking the
>>>> cross references in the Rd files.
>>>> What is the preferred way to make this warning go away?
>>> Follow the 'Writing R Extensions' manual.  There is a 3-item bullet
>>> point in §1.1.1 following
>>>       'The general rules are'
>>> and your claims contradict the third point.
>>>> Thanks in advance,
>>>>      Kevin
>>>> ______________________________________________
>>>> R-devel at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>> --
>>> 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
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list