[Rcpp-devel] Equivalent to the which function in Rcpp / Access to a data.frame's indices?

Asis Hallab asis.hallab at gmail.com
Fri Jul 18 18:51:02 CEST 2014

Dear Rcpp-Experts,

in Rcpp I want to quickly identify matching rows in a data.frame.

In R I would do the following:

matching.rows <- my.data.frame[ which(
my.data.frame$column.of.interest == 'value_of_interest' ), ]

How to do something similar in Rcpp?
If I am not mistaken R data.frames and matrices do have some implicit
index, thta allows very fast identification of matching positions,
don't they?

If it helps I could do that on an Rcpp::Matrix instead of a DataFrame…

Help will be much appreciated.
Have a pleasant weekend, and

More information about the Rcpp-devel mailing list