[Rcpp-devel] Correlation in ArmadilloRcpp with missing values (nan)
cubranic at stat.ubc.ca
Fri Oct 12 01:17:27 CEST 2012
According to Armadillo docs, submat's arguments are two uvec's, not a uvec and an int.
On 2012-10-09, at 11:06 AM, mateusz.kaduk at gmail.com wrote:
> Maybe I am not good in coding, but even though I managed to make uvec with ones and zeros, I cannot use it to select rows in given column, compiler complains
> error: no matching function for call to ‘arma::Mat<double>::submat(arma::uvec&, int&)’
> On 9 October 2012 19:55, Dirk Eddelbuettel <edd at debian.org> wrote:
> On 9 October 2012 at 19:07, mateusz.kaduk at gmail.com wrote:
> | Can you provide an example how to convert Armadillo colvec to uvec vector which
> | I assume works as selector for rows?
> You may need to loop (or use STL iterators) to fill the uvec position by
> position. Then use the subset, and proceed with your correlation
> calculation. I don't think there is a shortcut.
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Rcpp-devel