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
.
Something like \link{pck=PACKAGE_NAME, fun=FUNCTION_NAME}
?
You have to type \link[pkg]{function}
e.g. \link[stringi]{stri_c}
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.
来源:https://stackoverflow.com/questions/25489042/linking-to-other-packages-in-documentation-in-roxygen2-in-r