Indexing slice from 3D Rcpp NumericVector
Hi I have what I think must be a really simple Rcpp question regarding treating NumericVector objects as multidimensional arrays. I can't find an answer to what might be obvious. Apologies up front if this is the case -- my inexperience with C++ is to blame... If I use the answer posted here a ( Constructing 3D array in Rcpp ) as an example library("Rcpp") cppFunction(code=' NumericVector arrayC(NumericVector input, IntegerVector dim) { input.attr("dim") = dim; return input; } ') How do I extract/access an single slice / row / column out of the "intput" object? I.e. Do something like