R Roxygen link to parent function
Asked Answered
S

1

4

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.

Sensuous answered 16/11, 2013 at 3:19 Comment(3)
@importsFrom XYZ ABC, no?Pileous
\code{\link[XYZ]{ABC}}Nomarch
Thats it. Put it in an answer and Ill tick it.Sensuous
N
8

\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.

Nomarch answered 16/11, 2013 at 15:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.