[Rcpp-devel] Correlation in ArmadilloRcpp with missing values (nan)
Davor Cubranic
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.
Davor
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
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121011/212676cf/attachment.html>
More information about the Rcpp-devel
mailing list