Thanks for your useful comments, I am trying something like this in a R file (I have changed the name of my c++ method compared with the example above, now is called myMethodCpp in order to avoid conflicts with the R name's function):
myClass$myMethod <- function(param1, param2 = 0L) { invisible(.Call('myMethodCpp', PACKAGE = 'mypackage', param1, param2)) } but when I compile the code I get the error: objet 'myClass' not found Do you know how can I fix it? Is there a package which does something similar? Thank you very much, Sergio 2016-10-26 19:10 GMT+02:00 Dirk Eddelbuettel <e...@debian.org>: > > On 26 October 2016 at 10:05, Hao Ye wrote: > | In sum, the easiest may be to 'hide' the module and deal with this > from the > | R > | side exposing both variants from there and then just calling the one > you > | have now. > | > | > | I agree - though I don't think you even need two variants of the C++ > function > | if there's an R function to handle default arguments. > > Good catch, and sloppy wording on my part. This is what I meant. > > 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