> 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/