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

Elysée Aristide @r|e|92@nd @end|ng |rom gm@||@com
Sun Nov 13 12:29:21 CET 2022


Greetings,

I would like to follow up on this issue.
First of all, thank you to everyone who took the time to think about the issue.
As Mr. Dirk Eddelbuettel suggested,  I investigated other packages that perform numerical optimizations using RcppNumerical. The only difference I saw is that all those packages put

#define NDEBUG

after #include <RcppArmadillo.h>.
I did the same thing without understanding :). This solves the issue.


Best,
Aristide

________________________________
From: Dirk Eddelbuettel <edd using debian.org>
Sent: Saturday, October 22, 2022, 4:22 p.m.
To: Elys�e Aristide <ariel92and using gmail.com>
Cc: Dirk Eddelbuettel <edd using debian.org>; Ivan Krylov <krylov.r00t using gmail.com>; r-package-devel using r-project.org <r-package-devel using r-project.org>
Subject: Re: [R-pkg-devel] How ton print in the console from Rcpp


On 20 October 2022 at 13:16, Elys�e Aristide wrote:
| Thank you very much for your answers.
|
| I finally noticed that the issue comes from the numerical optimization, in which I use the class MFuncGrad of the package RcppNumerical. Is there any problem in using this class? This is the only way I know to compute integrals of perform numerical optimizations in Rcpp. The other way might be: construct the function to be minimized in Rcpp and use the function optim in R. But this is not efficient.

That package is also used by others [1] and you should maybe study their code
and setup as it seems unlikely to me that your woes are due to
RcppNumerical. It likely is a simple inadvertent issue in your package.

Dirk

[1] https://cloud.r-project.org/web/packages/RcppNumerical/index.html shows
Reverse imports:
  BayesPPD, ccdf, glmdisc, MCPModPack, secr, teachingApps
Reverse linking to:
  apeglm, BayesPPD, BVSNLP, CDatanet, COMIX, fido, gbeta, glmdisc,
  MCPModPack, OwenQ, secr, teachingApps, vennLasso, ztpln
which should give you plenty of examples.


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


	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list