Rcpp: why I can not run the function in my defined package?
问题 I use the following steps to achieve my own package: 1)I try to write a very simple function as follows: #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] int foo() { return 6; } 2) I use skeleton to make it into a package: Rcpp.package.skeleton("newpackage",example_code=FALSE,cpp_files=c("New.cpp")) 3) I run cpp with command: source("~/newpackage/src/New.cpp") 4) run compileAttributes to load the package: compileAttributes(pkgdir="/home/tw72/newpackage",verbose = getOption("verbose