Hi Dirk. Thanks for your time and trouble. I agree there are simpler ways to achieve this functionality, but if I don't get around this, I won't be able to produce the thing I'm really after.
> Why is retMat on the right-hand side if you try to fill it? Makes no real sense. >From rcpp-quickref: // Reference the second column // Changes propagate to xx (same applies for Row) NumericMatrix::Column zzcol = xx( _, 1); zzcol = zzcol * 2; Only difference in my code was that I was assigning from a NumericVector instead of from an altered version of the original NumericMatrix::Column. Or am I mistaken here? I've put it here again: NumericVector curcol = df(i); NumericMatrix::Column cl = retMat( _, i); cl = curcol;//from rcpp-quickref, I understand this alters the matrix? Then you appear to suggest that my approach using the "dim" attribute is no good, or at least you get the dimensions in a very different way (by using the data.frame as a list). I agree your way works, but why shouldn't mine? In any case, this sort of thing would be a valuable addition to Rcpp in my opinion. Finally, you use: >+ V = DF[i]; >+ M(_,i) = V; // one way to assign using sugar operator _ Which makes me wonder: * why DF[i] and not DF(i) (what's the difference - I still have not found a clear explanation) * is M(_,i) = V; any different from NumericVector cl = M(_,i);cl=V; ? If so, how so? * thanks for letting me know _ is part of sugar. I may be able to figure out its use now, but isn't this worthy of a mention in rcpp-sugar.pdf? Thanks, Nick Sabbe -- ping: nick.sa...@ugent.be link: http://biomath.ugent.be wink: A1.056, Coupure Links 653, 9000 Gent ring: 09/264.59.36 -- Do Not Disapprove _______________________________________________ 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