[R-pkg-devel] How ton print in the console from Rcpp

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Thu Oct 20 14:42:23 CEST 2022


On 20 October 2022 at 14:46, Ivan Krylov wrote:
| В Thu, 20 Oct 2022 12:43:30 +0200
| Elysée Aristide <ariel92and using gmail.com> пишет:
| 
| > What I understood is that it is better to use Rcpp functions. So I
| > used:
| > 
| > Rcpp::Rcout << "beta: \n";
| > Rcpp::print(betacpp);
| > Rcpp::Rcout << "log-likelihood: " << llh << "\n";
| 
| This seems to be a right way of printing from Rcpp code.

Yup!

And as stated that alone does not cause `__assert_rtn` or many of the now
almost 2600 Rcpp-using packages (that print this way) would have issues.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list