With a NumericMatrix, it is easy to access a specific element. For example, we can access the element of row i and col j of the NumericMatrix X with X(i, j). Is there an equivalent operator for a Rcpp::DataFrame?
I am looking for a yes/no answer or a short example.
The short answer is a no, just as to your question from yesterday. A
data.frameis a list of vectors so a homogenous-style accessor cannot work as it does for a Matrix.A short example of what actually works follows. Note that this appears to have been answered by the DataFrame example in package RcppExamples from which can quote:
It helps to rember that a
data.framereally is a list of vectors.