[Rcpp-devel] Working with strings

Hadley Wickham h.wickham at gmail.com
Sat Nov 17 15:22:30 CET 2012


Hi all,

Am I doing something wrong with the functions below, or has this
behaviour not yet been implemented in Rcpp?

    cppFunction('std::string first_char(CharacterVector x) {
      return x[0];
    }')

    cppFunction('CharacterVector miss_c() {
      return CharacterVector::create(NA_STRING);
    }')

Hadley

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


More information about the Rcpp-devel mailing list