Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork219
Closed
Description
This fails because of missingstd::hash<String>.
// [[Rcpp::export]]IntegerVectormatchCpp( CharacterVector x, CharacterVector table){// first train an unordered_map std::unordered_map<String,int> map ;for(int i=0; i<table.size(); i++){ String s = table[i] ; map[s] = i +1 ; }// now lookupint n = x.size() ; IntegerVectorout(n) ;for(int i=0; i<n; i++){ String s = x[i] ; out[i] = map[s]->second ; }return out ;}