私はRcppパッケージでいくつかのテストを行ってきましたが、それはうまく機能します。
CharacterVectorをRからC++に渡すときに少し問題があります。
RcppExport SEXP testArray(SEXP Rarr){
Rcpp::CharacterVector cx(Rarr);
Rcpp::LogicalVector r(1);
std::string test = "a";
r[0] = (*(const char*)cx[0] == *(const char*)test.c_str());
const char * temp = (const char*)cx;
return Rcpp::wrap(temp.size());
}
上記のコードに基づいて「Rcpp::CharacterVectorcx」のサイズを取得することは可能ですか?
のようなもの:cx.size()またはlength(cx)?
よろしく、
アンディ