[Rcpp-devel] Extending Rcpp with a dummy class

Alessandro Mammana mammana at molgen.mpg.de
Fri Feb 14 13:43:37 CET 2014


What is exactly "the old school way"?
1. Hacking the automatically generated RcppExports.cpp by adding that line?
2. Keeping the SEXP in the function definitions and converting them
manually one-by-one?
That's surprising... that this feature works well with sourceCpp and
not when deploying packages...


On Fri, Feb 14, 2014 at 1:31 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> On 14 February 2014 at 11:02, Alessandro Mammana wrote:
> | Thanks a lot, I misunderstood the document
> | http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-extending.pdf
> | .
> | But there is still a problem when I try to use these classes
> | definitions in a package.
> | If these classes are defined in the file classdef.cpp, I somehow need
> | to add the line #include "classdef.cpp" in the file RcppExports.h.
> | Because this file is automatically generated, I looked for some Rcpp
> | attribute that adds this line. Rcpp::depends could be the one, but
> | I don't see how to use it, since classdef.cpp is not an Rcpp package.
> | I also tried just to add -I../inst/include in the Makevars and a
> | header classdef.h in
> | that directory, but this does not seem to add the desired line.
> | One again I am lost...
> | What should I do?
>
> That is a different issue. Rcpp Attributes is wonderful to automate getting
> functions to R.
>
> It has nothing for as<> and wrap. You have to do that the old school way.
>
> Dirk
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



-- 
Alessandro Mammana, PhD Student
Max Planck Institute for Molecular Genetics
Ihnestraße 63-73
D-14195 Berlin, Germany


More information about the Rcpp-devel mailing list