R with roxygen2: How to use a single function from another package?
<p>I'm creating an R package that will use <strong>a single function</strong> from <code>plyr</code>. According to <a href="https://cran.r-project.org/web/packages/roxygen2/vignettes/namespace.html" rel="nofollow noreferrer">this roxygen2 vignette</a>:</p>

<blockquote>
  <p>If you are using just a few functions from another package, the
  recommended option is to note the package name in the Imports: field
  of the DESCRIPTION file and call the function(s) explicitly using ::,
  e.g., pkg::fun().</p>
</blockquote>

<p>That sounds good. I'm using <code>plyr::ldply()</code> - the full call with <code>::</code> - so I list <code>plyr</code> in <code>Imports:</code> in my <code>DESCRIPTION</code> file. However, when I use <code>devtools::check()</code> I get this:</p>

<pre><code>* checking dependencies in R code ... NOTE
All declared Imports should be used:
  ‘plyr’
  All declared Imports should be used.
</code></pre>

<p><em>Why do I get this note?</em></p>

<p>I am able to avoid the note by adding <code>@importFrom dplyr ldply</code> in the file that is using <code>plyr</code>, but then I end but having <code>ldply</code> in my package namespace. Which I do not want, and should not need as I am using <code>plyr::ldply()</code> the single time I use the function.</p>

<p>Any pointers would be appreciated!</p>

<p>(<a href="https://stackoverflow.com/questions/28335991/package-imports-error-on-devtoolscheck">This question</a> might be relevant.)</p>