I am creating a package with Rcpp using Rstudio. Everything worked fine until I added documentation markup to my function file. I hope I miss something obvious.
Here is my R function file:
And after running devtools::document() it looks like a namespace file:
# Generated by roxygen2 (4.0.2): do not edit by hand export(fast.table) importFrom(Rcpp,"C++") importFrom(Rcpp,Does) importFrom(Rcpp,NAs.) importFrom(Rcpp,Only) importFrom(Rcpp,R) importFrom(Rcpp,currently) importFrom(Rcpp,fast.table) importFrom(Rcpp,function.) importFrom(Rcpp,handle) importFrom(Rcpp,implementation) importFrom(Rcpp,not) importFrom(Rcpp,numeric) importFrom(Rcpp,of) importFrom(Rcpp,sourceCpp) importFrom(Rcpp,supports) importFrom(Rcpp,table) importFrom(Rcpp,the) importFrom(Rcpp,vectors.) useDynLib(tablr)
As you can see, the @importFrom tag @importFrom the text of the function header and tries to import every word from the Rcpp package.
Error message after running devtools::document() :
Error: object 'C++' is not exported by 'namespace:Rcpp' Execution halted Exited with status 1.
And session information:
> devtools::session_info() Session info---------------------------------------------------------------------------------- setting value version R version 3.1.1 (2014-07-10) system x86_64, mingw32 ui RStudio (0.98.1049) language (EN) collate English_United States.1252 tz America/Chicago Packages-------------------------------------------------------------------------------------- package * version date source devtools 1.6.1 2014-10-07 CRAN (R 3.1.1) Rcpp 0.11.3 2014-09-29 CRAN (R 3.1.1) roxygen2 4.0.2 2014-09-02 CRAN (R 3.1.1) rstudioapi 0.1 2014-03-27 CRAN (R 3.1.1) stringr 0.6.2 2012-12-06 CRAN (R 3.1.0) tablr * 0.1 <NA> local
source share