Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206180

Rcpp::compileAttributes() not updating .R file

$
0
0

I am trying to build a package in R involving the Rcpp package. When I generated the package using the command Rcpp.package.skeleton("pck338").

By default, the files rcpp_hello_world.cpp is included, and the RcppExports.cpp file is included as well.

To my understanding, the compileAttributes() function needs to be run every time a new .cpp function is added to the src directory.

To that end, I wrote a simple function in the rcpp_dance.cpp file that goes like this:

# include <Rcpp.h>
using namespace Rcpp;

// [[Rcpp:export]]
int rcpp_dance(int x) {
  int val = x + 5;
  return val;
}

However, when I run the compileAttributes(), the RcppExports.cpp stays the same, so the dance function is not converted to an R function. Why is this happening? Any specific and general feedback would be appreciated.


Viewing all articles
Browse latest Browse all 206180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>