Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork219
Description
As outlined in aSO question, when sourcing acpp-file with embedded R code, there is no option to silence the R output.
This can be seen by running:
Rcpp::sourceCode(code='#include <Rcpp.h>// [[Rcpp::export]]Rcpp::NumericVector timesTwo(Rcpp::NumericVector x) { return x * 2;}/*** Rtimes_two <- function(x) timesTwo(x)*/')#> times_two <- function(x) timesTwo(x)
I opened this issue so we can discuss if this is needed.
I use embedded R code to define an R wrapper around a cpp function in one file, reducing the number of files needed (e.g., define a cpp function, which returns a data.frame, then call somedplyr ordata.table code on the data.frame). I would like to prevent printing the R code when I callsourceCpp(), for example in some kinds of rmarkdown format.
As pointed out byMrFlick, it would require changing theAttributes.R L217 call tosource(), which could include an optionshowROutput orsilenceR or similar.