[Rcpp-devel] file name changed in package

Dirk Eddelbuettel edd at debian.org
Fri May 23 00:50:12 CEST 2014


On 22 May 2014 at 15:38, Chaomei Lo wrote:
| Hi, Dirk,
|  
| I have created R packages using Makevars and it works pretty good for me. I am
| able to convert from a Rcpp::NumericVector to std::vector as in below.
|  
| NumericVector col_cts = buildMatrix(Xr);
| 
| vector<long unsigned int> col_counts = Rcpp::as<vector<long unsigned int>>
| (col_cts);
|   
| Now I am having a problem with an application involves the Trilinos library.
| Here below I am trying to convert a Rcpp::NumericVector to Teuchos::ArrayRCP
| <size_t> in the following line, it gave me errors as shown below in red.  Would
| you please help me with this ?
|  
| Teuchos::ArrayRCP<size_t> col_counts=Rcpp::as<Teuchos::ArrayRCP<size_t>>
| (col_cts);

"There is a vignette for that":  Rcpp-extending, which describes how to
create as<>() and wrap() for your chosen library.

There are examples in existing packages such as RcppArmadillo, RcppBDT and
more.  There are examples on the Rcpp Gallery.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list