[Rcpp-devel] Rcpp.package.create(attributes=TRUE)

Dirk Eddelbuettel edd at debian.org
Wed Feb 27 05:34:19 CET 2013


Greg,

On 26 February 2013 at 23:00, Greg Minshall wrote:
| Dirk,
| 
| > Show reprocucible errors, or the mail doesn't exist ;-)
| 
| works for me! (**) build the example skeleton with attributes=FALSE, "R

Works for me too. Nice example. 

Not sure what is going on / causing it, but I think you are correct ...

| CMD build", install.packages(), library(), run rcpp_hello_world(), note
| that a list with two items (each a 2 element vector) is returned.  (or,
| just enter rcpp_hello_world to see its definition, and notice you get a
| .Call().)
| 
| now, build with attributes=TRUE, run compileAttributes(), "R CMD build";
| install.packages(), library(), run rcpp_hello_world(), and if it fails
| NULL is returned.  (in this case, rcpp_hello_world will show an empty
| function.)
| 
| it makes sense to me this would work (fail) this way, because both the
| files in the anRpackage/R directory are defining the same global
| (function) variable, i.e., rcpp_hello_world.  so, i assume whichever of
| these two .R files is interpreted last when the package is loaded will
| take precedence.

... here.  If in the 'bad' example I comment that function out as

#rcpp_hello_world <-
#function ()
#{
#}

then the 'bad example' too works.  This all is JJ's excellent work, so maybe
he has a clearer view of why rcpp_hello_world ends up being shadowed.  Maybe
the example just needs a different name...

I bootstrapped a few small packages using rcpp.package.skeleton including one
with attributes where it didn't bite me.  Maybe I just delete the 'hello,
world' placeholder.

Thanks for the report, Greg.  We'll take a look.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list