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

Greg Minshall minshall at umich.edu
Wed Feb 27 03:27:06 CET 2013


hi.  if i Rcpp.package.skeleton(), i get this single R file,
anRpackage/R/rcpp_hello_world.R:
----
rcpp_hello_world <- function(){
        .Call( "rcpp_hello_world", PACKAGE = "anRpackage" )
}
----

on the other hand, if i Rcpp.package.skeleton(attributes=TRUE), i get
two R files: RcppExports.R and rcpp_hello_world.R.  the former appears
to be what is wanted
----
# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

rcpp_hello_world <- function() {
    .Call('anRpackage_rcpp_hello_world', PACKAGE = 'anRpackage')
}
----
whereas the latter looks like.
----
rcpp_hello_world <-
function () 
{
}
----

i'm assuming the creation, in this case, of rcpp_hello_world.R is a
mistake?  it seems to be evaluated when loading the resultant package,
presumably *after* RcppExports.R, causing a gaping black hole.
(deleting it before "R CMD build" seems to work.)

(this is Rcpp_0.10.2.)

cheers, Greg


More information about the Rcpp-devel mailing list