Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 644 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 644 Bytes

secret

Make Secret Functions in package

To hide the source code of R functions in package, take the following steps:

  1. Call devtools::use_rcpp() to initiate using Rcpp in package.

  2. Call secret::use_secret() to initiate using secret in package.

  3. Write anonymous functions in ./secret.

    For example, create ./secret/test.R:

    function(x) {
      x + 100
    }
  4. Call secret::build_secret() which converts all R scripts in ./secret to corresponding C++ source files in ./src. In the example, ./secret/test.R is converted to ./src/test.cpp.

  5. Build and distribute the package in binary format.