Skip to content

R6 methods shouldn't have crossreferences to base functions of the same name #1258

@nealrichardson

Description

@nealrichardson

The upcoming roxygen2 7.0 release adds new support for R6 classes, including generating doc entries for class methods. pkgdown is mistakenly interpreting these as any other code example and adding crossreference links to other packages' man pages.

In the arrow package, we have R6 classes that wrap file/connections in Arrow C++, and they have some methods that are the same name as base functions for working with connections in R. For example, roxygen2 created this Rd chunk for a method:

\if{html}{\out{<hr>}}
\if{html}{\out{<a id="method-seek"></a>}}
\subsection{Method \code{seek()}}{
\subsection{Usage}{
\if{html}{\out{<div class="r">}}\preformatted{RandomAccessFile$seek(position)}\if{html}{\out{</div>}}
}

pkgdown rendered that as

<p><hr>
<a id="method-seek"></a></p><h3>Method <code><a href='https://rdrr.io/r/base/seek.html'>seek()</a></code></h3>

<h3>Usage</h3>
<p><div class="r"></p><pre>RandomAccessFile$seek(position)</pre><p></div></p>

The link to https://rdrr.io/r/base/seek.html shouldn't be there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    R6 6️⃣bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions