3

I work from different computers on the same R package with Rstudio, but for some reason, whenever I build the package, some of the computers will modify the RcppExports.R and RcppExports.cpp files by adding underscore in front of some functions. For example, this can be found when looking at the dif between the files before and after compiling the package (first line is before, second is after):

    .Call('PkgName_FunctionName', PACKAGE = 'PkgName', arguments)
    .Call('_PkgName_FunctionName', PACKAGE = 'PkgName', arguments)

This bothers me because git sees this as a change.

My questions are:

  • Why is the underscore included?
  • What can I do to have compiling the package not modify any of the files?
VFreguglia
  • 2,129
  • 4
  • 14
  • 35
  • 1
    Are you using different versions of R/packages on the different machines? It's much easier to help when you provide some sort of [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) or enough information to recreate the error. – MrFlick Jan 02 '18 at 20:21

1 Answers1

4

Make sure you have the same (current) versions of Rcpp on both machines. Then the RcppExports.{R,cpp} files will be identical.

The change was a requirement from R upstream (around R 3.4.0) and we needed to adjust.

Also note that you probably want registration=TRUE in your NAMESPACE file in which case the form becomes

.Call(`_PkgName_FunctionName`, arguments)
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725