[Rcpp-devel] Rcpp::DataFrame and factors

2010-05-06 Thread Romain Francois
Hi, The new Rcpp::DataFrame follows R's tradition and automatically converts character vectors into factors: > fun <- cppfunction( signature(), ' + IntegerVector v = IntegerVector::create(1,2,3); + std::vector s(3); + s[0] = "a"; + s[1] = "b"; + s[2] = "

[Rcpp-devel] Rcpp::DataFrame

2010-04-26 Thread Romain Francois
Hello, I've commited some initial code for Rcpp::DataFrame. Interesting bits are: DataFrame( SEXP ) ; DataFrame::create( { between 0 and 20 arguments of whatever type wrap can handle } ) ; So for example: > fx <- cppfunction( , ' + std::vector s(2) ; + s[0] = "hello"; + s[1] = "world"; + + I