On 15 December 2021 at 12:30, Robert J. Hijmans wrote:
| Dirk thanks very much for the help. And sorry, Alex, I misspoke. I meant to
| say that Rcpp will coerce a R "numeric" (vector) to an
| "Rcpp::IntegerVector" if you ask it to do so (and that is what happened in
| the context we were discussing).

Exactly. And it will be no comfort to Alex who has to chase this by hand but
for those of us old enough to C/C++ time in (whole) decades, it really just
smells *very much* like an old-fashioned indexing error.  Which is why
valgrind was already a good idea.

Minor hint:
   Rcpp::stop("Something here including %d or %s or ... formatting", a, b);
is a tad more Rcpp-idiomatic, and errors.  We now have Rcpp::message(...) to
just do the printing (in a suppressable way). C API of R of course still holds.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to