Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Roxygen link to parent function

Consider a base package XYZ, written by someone else, which has a function ABC, I want to extend the functionality of ABC in my new (NOT XYZ) package via the following method.

ABC <- function(...){
  ##INSERT EXTRA WORK.

  ##CALL THE BASE METHOD
  XYZ::ABC(...)
}

Now I want to document my new function ABC (via Roxygen), creating a link to the parent function for reference purposes.

\code{\link{XYZ::ABC}} does not work, no function cannot be found.

\link{ABC} creates a link to a list of possible candiate Rd files,

How do I create the hyperlink DIRECTLY to the BASE function.

like image 256
Nicholas Hamilton Avatar asked Mar 22 '23 15:03

Nicholas Hamilton


1 Answers

\code{\link[XYZ]{ABC}}

This is briefly documented in the Cross-references section of Writing R Extensions:

There are two other forms of optional argument specified as \link[pkg]{foo} and \link[pkg:bar]{foo} to link to the package pkg, to files foo.html and bar.html respectively.

like image 57
GSee Avatar answered Apr 02 '23 14:04

GSee