Rcpp modules - example programs not working
<p>I am trying to understand how <code>Rcpp</code> modules work. I tried the full example (on page 14) in the <code>Rcpp</code> <a href="http://dirk.eddelbuettel.com/code/rcpp/Rcpp-modules.pdf" rel="nofollow">vignette</a>. However, I don't know where <code>fx_vec</code> is defined, therefore I am not able to run the full example.</p>

<p>Then, I tried to compile the package is <code>Rcpp</code> source code (<a href="https://github.com/RcppCore/Rcpp/tree/master/inst/unitTests/testRcppModule" rel="nofollow">here</a>). I had to make the following changes to compile the package</p>

<ul>
<li>I had to delete the <code>zzz.R</code> file in the <code>R</code> folder.</li>
<li>I had to comment the line 48 in <code>stdVector.cpp</code> (<code>//.method( "resize", &amp;vec::resize</code>)) </li>
</ul>

<p>I am able to compile the <code>testRcppModule</code> package now (original source code <a href="https://github.com/RcppCore/Rcpp/tree/master/inst/unitTests/testRcppModule" rel="nofollow">here</a>), however, I am still not able to run the program <code>modules.R</code> in the <code>test</code> folder. For reference, the package I have been to compile can be found <a href="https://github.com/sn248/testRcppmodule" rel="nofollow">here</a> (note that the package names varies slightly from the original name in <code>Rcpp</code>).</p>

<p>The error I get on running code <code>v &lt;- new (vec)</code> in <code>modules.R</code> is as follows</p>

<pre><code>&gt; library(testRcppmodule)
&gt; v &lt;- new(vec)
Error in .getClassFromCache(Class, where, resolve.msg = resolve.msg) : 
  object 'vec' not found
</code></pre>