Re: [Rcpp-devel] How to extract rows or columns by vector of indices

2012-02-10 Thread Dirk Eddelbuettel
On 10 February 2012 at 15:56, Andy Leung wrote: | Dear Rcpp users and developers, | | I understand how to extract a single column or row from an | RcppArmadillo matrix, but I am still unsure how to extract columns or I use span() methods a lot too, but thety are continuous... | rows based on a

[Rcpp-devel] How to extract rows or columns by vector of indices

2012-02-10 Thread Andy Leung
Dear Rcpp users and developers, I understand how to extract a single column or row from an RcppArmadillo matrix, but I am still unsure how to extract columns or rows based on a vector of indices. I wrote a rather awkward (and dumb) way to extract, and here are some reproducible codes: ###