Ale,

Try this:

  R> sourceCpp("/tmp/scratchpad.cpp")
  R> test()
  [1] 1 2 3
  R> 

Using the file below. 

Dirk

-----------------------------------------------------------------------------

#include <Rcpp.h>

using namespace Rcpp;

// [[Rcpp::export]]
IntegerVector test(){
    std::vector<int> a;
    a.push_back(1);
    a.push_back(2);
    a.push_back(3);
    return wrap(a);
}

-----------------------------------------------------------------------------

-- 
Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to