[Rcpp-devel] Converting std::cout to Rcpp::Rcout automatically

Romain François romain at r-enthusiasts.com
Sat May 24 06:53:53 CEST 2014


I used to redirect std::cout to Rcpp::Rcout back when I still had Rcout in Rcpp11. e.g. https://github.com/Rcpp11/Rcpp11/blob/22cc410ea87a2668e547acf6510d07ca812dfca8/src/Rcpp11_init.cpp

Which was basically leveraging std::cout.rdbuf. 
A variant of http://stackoverflow.com/questions/10150468/how-to-redirect-cin-and-cout-to-files

And then just using std::cout; Of course then you get CRAN complaining. 


> Hi, dear all,
> I am using Rcpp to integrate an available C++ library with R.
> Since the std::cout and std::cerr are not permitted when uploading to CRAN, I have to modify files manually. It will be somewhat laborious if the library 
> Does anyone have any idea how can I do that automatically?
> Thank you!
> Best,
> KK
> -- 
> Qiang Kou
> qkou at umail.iu.edu
> School of Informatics and Computing, Indiana University
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140524/21d92903/attachment-0001.html>

More information about the Rcpp-devel mailing list