In my R package, I implemented the [
(indexing) operator for my class:
#' Some title
#' @export
setMethod("[", list(x="MyClass"), function(x, i, j, ...) {
# Some code
})
Now, in the package documentation I want to link to the manual entry for this method. I try the normal way, using methodName,className-method
:
#' [[,MyClass-method]
But that just puts a left bracket outside of the \link
command in the .Rd
file:
[\link{,MyClass-method}
If I try to quote it in some way, I get other issues: I have tried backtick, single and double quotes, and finally doubling the bracket [[
but none of these seem to produce a link that actually works in the final PDF.
How can I cross reference a [
method using Roxygen?