Question

My hyperSpec package provides functions to work with spectoscopic data sets. I provide hyperSpec-methods for quite a number of functions coming from other packages. However, some of these other packages, I have listed as Suggests: as I do not want to force users to install something like 20 other packages (counting dependencies) if they may never use the specific functionality.

From the coding point of view, that works nicely. However, I'm at a loss how to deal with that in the .Rd file - but I'm sure it is a rather common problem.

The usual \code{\link[otherpkg]{fun}} will not reliably work, as there is no guarantee that otherpkg is available. If otherpkg is not installed, then the link is broken. That will be detected by R CMD check e.g. on Winbuilder and r-forge. Which means: the package won't pass CRAN checks.

Which packages would be a good example to look at?

The only hint (though no solution) I found so far: https://stat.ethz.ch/pipermail/r-devel/2009-November/055425.html (but there was no answer to that email).

Was it helpful?

Solution 2

In the end, I made otherpkg a dependency.

OTHER TIPS

The Cross-References section of Writing R Extensions says that to link to other packages use

\link[otherpkg]{foo}

with the tricky / inscrutable thing being that foo is the name of the html help page that you want to link to (within a package, there would be no need for [mypkg] and foo would be an \alias in another man page). The name of the help page is determined by the \name directive in the Rd file defining the help you're interested in retrieving.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top