On 28 February 2014 at 11:52, Gregor Kastner wrote: | Hi Hideyoshi, | | > Is there a way I can just call that function in Rcpp rather than having to | > install new libraries or create my own? (I presume that there is probably a | > “C_do_fmin.c” file somewhere that I can use?) | | This questions has been discussed in this list about a month ago: | | http://r.789695.n4.nabble.com/Linking-to-native-routines-in-other-packages-tt4683969.html#none
Not exactly. That question was about calling from another package for which the calling-registered-functions approach was discussed; Hideyoshi wants to call a function from an R base package. That can be done, but can also be tricky because they don't exactly have the same calling interface: /* fmin(f, xmin, xmax tol) */ SEXP do_fmin(SEXP call, SEXP op, SEXP args, SEXP rho) It is a good exercise to work through the call, op, args arguments once :) In short, this is not trivial. Which is why I chose to quickly reimplement / rewrite the Brent algorithm in another function for (internal, not distributed) use as I alluded to in my earlier answer. Dirk -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com _______________________________________________ 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