Linking to other packages in documentation in roxygen2 in R

前端 未结 4 1256
伪装坚强ぢ
伪装坚强ぢ 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:50

    In addition to the answer by potockan:
    Some packages document several functions in a single help page. For example, the trim function from Bioconductor package GenomicRanges is documented in intra-range-methods (which is also the name of a help page from other packages such as IRanges).

    To link to the right page with roxygen2 you can use:

    \link[GenomicRanges:intra-range-methods]{trim} 
    

    or

    \code{\link[GenomicRanges:intra-range-methods]{trim}}  
    

    to format the text correctly.

    The help page will only show trim but will link to the right help page.

提交回复
热议问题