Linking to other packages in documentation in roxygen2 in R

Thanks. Mb you know where could I find a full list of roxygen2 documentation parameters like what's stand for @param or @family or so on? There are many that I couldn't find info about them anywhere. For example:

Commented Aug 25, 2014 at 15:22

roxygen2 now supports the more convenient [MASS::stats()] which evaluates to \link[MASS] when roxygen creates the .Rd files.

Commented Nov 24, 2023 at 11:55

5 Answers 5

You have to type \link[pkg] e.g. \link[stringi]

answered Aug 25, 2014 at 15:19 4,048 3 3 gold badges 26 26 silver badges 37 37 bronze badges so short answer but so valuable :) Commented Jun 5, 2018 at 11:07

note chapter "alternative documentation workflow" in hadley's book. In order to see the links, you have to rebuild the package, not only re-document.

Commented Mar 28, 2020 at 13:09

Roxygen2 now also supports documentation written in markdown.

The markdown syntax is for the link is [foo::bar()] which is translated to \code<\link[foo:bar]> in the generated .Rd file. (See Roxygen2 vignette.)

Note that you may need to specifically turn on Markdown support by writing Roxygen: list(markdown = TRUE) in your DESCRIPTION file, or by putting an #' @md comment if you want to enable markdown only for a specific man page. This is also explained at the very top of the linked vignette. (Thanks to @Tjebo for the comment)

Note that there are two colons in the markdown version whereas there is only one colon in the Rd version.