[Rcpp-devel] access to element of generic data frame

Antonio Piccolboni antonio at piccolboni.info
Tue Jun 26 02:43:25 CEST 2012


Hi,
 is there a a way to access a specific element of a data frame in Rcpp
without previous knowledge of the type of the columns? I see from
RcppExamples that one can do something like:

// construct the data.frame object
Rcpp::DataFrame DF = Rcpp::DataFrame(Dsexp);
// and access each column by name
Rcpp::IntegerVector a = DF["a"];
a[2] = 42;

which accesses DF[2, "a"] using the R syntax. Unfortunately, I don't have
the advance knowledge that column "a" will be an integer. I am trying to
write some code that would work for any frame. Suggestions? Thanks


Antonio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120625/a7f74e1e/attachment-0001.html>


More information about the Rcpp-devel mailing list