<p>Welcome to the sixth post in the really random R riffs series, or <span>R4</span> for short.</p>
<p>Posts <a href="http://dirk.eddelbuettel.com/blog/2017/03/29#001_easy_package_registration">#1</a> and <a href="http://dirk.eddelbuettel.com/blog/2017/03/30#002_even_easier_package_registration">#2</a> discussed how to get the now de rigeur package registration information computed. In essence, we pointed to something which R 3.4.0 would have, and provided tricks for accessing it while R 3.3.3 was still R-released.</p>
<p>But now R 3.4.0 is out, and life is good! Or at least this is easier. For example, a few days ago I <a href="https://github.com/eddelbuettel/littler/commit/002b3255225f7b690acb36179fd762ee4c6877b8">committed</a> this short helper script <code>pnrrs.r</code> to <a href="http://dirk.eddelbuettel.com/code/littler.html">littler</a>:</p>
<div><pre><code><span>#!/usr/bin/r</span>

if (<span>getRversion</span>() &lt;<span> &quot;3.4.0&quot;</span>) <span>stop</span>(<span>&quot;Not available for R (&lt; 3.4.0). Please upgrade.&quot;</span>, <span>call.=</span><span>FALSE</span>)

tools::<span>package_native_routine_registration_skeleton</span>(<span>&quot;.&quot;</span>)</code></pre></div>
<p>So with this example script <code>pnrrs.r</code> soft-linked to <code>/usr/local/bin</code> (or <code>~/bin</code>) as I commonly do with <a href="http://dirk.eddelbuettel.com/code/littler.html">littler</a> helpers, all it takes is</p>
<div><pre><code><span>cd</span> some/R/package/source
<span>pnrrs.r</span></code></pre></div>
<p>and the desired file usable as <code>src/init.c</code> is on <code>stdout</code>. Editing <code>NAMESPACE</code> is quick too, and we're all done. See the <a href="http://dirk.eddelbuettel.com/blog/2017/03/29#001_easy_package_registration">other</a> <a href="http://dirk.eddelbuettel.com/blog/2017/03/30#002_even_easier_package_registration">two</a> posts for additional context. If you don't have <a href="http://dirk.eddelbuettel.com/code/littler.html">littler</a>, the above also works with <code>Rscript</code>.</p>
<p>
This post by <a href="http://dirk.eddelbuettel.com/">Dirk Eddelbuettel</a> originated on his <a href="http://dirk.eddelbuettel.com/blog/">Thinking inside the box</a> blog. Please report excessive re-aggregation in third-party for-profit settings.
</p><p>