rcpp

How do I create a list of vectors in Rcpp?

Hi all. I'm writing an Rcpp module an would like to return as one element of the RcppResultSet list a list whose elements are vectors. E.g., .Call("myfunc")$foo should be something like: [[1]] [1] 1 [[2]] [1] 1 1 [[3]] [1] 1 1 1 (the exact numbers are not important here). The issue is that I don't know the right Rcpp way of doi...

How to make Rcpp find a new module?

Hi guys, After I successfully compiled a new Rcpp module (the example from "Exposing C++ functions and classes with Rcpp modules, Dirk Eddelbuettel Romain Francois") Following the instructions in the paper, require( Rcpp ) yada <- Module( "yada" ) R complained about errors: Error in FUN("_rcpp_module_boot_yada"[[1L]], ...) : n...

Read variables from global environment with inline Rcpp?

I'm following the example from the Rcpp intro Vignette, trying it with inline. f<-cxxfunction(signature(), plugin="Rcpp", body=" Environment global = Environment::global_env(); std::vector<double> vx = global['x']; ") but I get a compile error. file12384509.cpp: In function 'SEXPREC* file12384509()': file12384509.cpp:31: erro...

Linking to another package with R inline

I have a C++/Rcpp function the I need to compile and link to the pomp package to get access to a random number generator. I can get the header file included but how to I get it to link to the compiled code? CppColonized<-cxxfunction( sig=signature(x="numeric", t="numeric", params="numeric", dt="numeric"), plugin='Rcpp', includes ...