Linking to other packages in documentation in roxygen2 in R

前端 未结 4 1193
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 00:32

I am wondering it there exists a method to link to function from other package when I\'m trying to write a documentation for new package using roxygen2

4条回答
  •  太阳男子
    2021-02-01 00:58

    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]{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.

提交回复
热议问题