[Rcpp-devel] Dispatching based on SEXPTYPE

Hadley Wickham h.wickham at gmail.com
Tue Nov 20 19:26:15 CET 2012


>   switch(x.sexp_type()) {
>     case REALSXP:
>       return wrap(unique1(as<NumericVector>(x)));
>       break;
>     case INTSXP:
>       return wrap(unique1(as<IntegerVector>(x)));
>       break;
>     case CHARSXP:

That should be STRSXP, of course.

Hadley

-- 
RStudio / Rice University
http://had.co.nz/


More information about the Rcpp-devel mailing list