On 8 November 2019 at 10:06, LEVRA-JUILLET William wrote: | I'm evaluating RInside/Rcpp to interact our C++ project with R. | I've seen the samples to get/set data (matrix, dataframes, etc) to/from R and it builds/works fine. | (Using gcc/mingw compiler from RTools on Windows) | | My questions is about functions... | My project is C++, and it uses RInside to call R from our code. | Let's say I have a C++ function implemented in my project, and I want to pass that c++ function to R so it can be "used" as a R function (typically passed as argument to optim/optimize) | I couldn't find a way to do that using RInside.
I think the passage of objects is unchanged. Rcpp does that. The best reference for me is still the RcppDE because _it does just that_ in the context of optimisation: pass a user provided C++ function around. Doing that from RInside should really work the same way. Same C++. It has been used in a few places, as has the XPtr helper setup by Inaki which he also mentioned to you. Dirk -- http://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