Re: [Rcpp-devel] S3 methods with cppFunction/sourceCpp

2012-12-27 Thread Christian Gunning
On Thu, Dec 27, 2012 at 4:06 PM, JJ Allaire wrote: > Hi Chistian, > > With sourceCpp, you can actually specify an exported function name > explicitly in the export declaration. For example: > > // [[Rcpp::export("fun.class")]] Great, thanks. I hadn't tried that. I did search the Rcpp-attributes

Re: [Rcpp-devel] S3 methods with cppFunction/sourceCpp

2012-12-27 Thread JJ Allaire
Hi Chistian, With sourceCpp, you can actually specify an exported function name explicitly in the export declaration. For example: // [[Rcpp::export("fun.class")]] So this will work for sourceCpp but alas isn't currently possible for cppFunction. One way around this for cppFunction would be to p

[Rcpp-devel] S3 methods with cppFunction/sourceCpp

2012-12-27 Thread Christian Gunning
I just realized that cppFunction can't natively build S3 functions, since fun.class isn't valid C++ function name. I'm wondering if adding and S3class argument (default value = FALSE, otherwise class name as character) to cppFunction makes sense -- all that's needed is appending the class name