Rcpp: dynamically update a list
问题 I am seeking solutions to dynamically updating a list. #include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] List Test(){ List L; List L1=List::create(12,45,22,44); L=Language("c",L,L1).eval();//update, add L1's elements on L's back. return L; } The above doesn't work since "List L;" makes L an empty list. However, if I write an additional function: List connectlist(List& a, List& b){ return Language("c",a,b).eval(); } and replace "L=Language("c",L,L1).eval();" with "connectlist(L,L1);"