I am not running R's cor(..) function. I am calling arma::cor(...) on two vectors. I cannot use R's function, because I have some nested loops and extra steps before calculating Pearson's correlation.
The only thing I am providing in R is the matrix with values and matrix with zeros and ones where missings are. Now in ArmadilloRcpp I need to select rows with values. The problem is that given arma::mat x and arma::colvec rowind, I cannot select value in this way colvec col = x(rowind,i); So forget about correlations, there are more steps. The problem is how to select with Armadillo values in rows from specific column. Lets say colvec col = { 1,1,1,1,0,1} and I want to select only values where there is 1 from column "i" of arma::mat x I hope it became clear, that this is not related to correlations, but how to select values (without missings). On 9 October 2012 19:43, Douglas Bates <ba...@stat.wisc.edu> wrote: > By the way, how are you calculating this correlation in R? Are you > using the cor function? > > I'm confused because the cor function in R does a bit of bookkeeping > then calls a C function using .Internal. It seems unlikely to me that > one could make a C++/Rcpp function run much faster. > >
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel