<div>Another thing worth thinking about: perhaps the easiest way to side-step the issue is to work with a NumericMatrix rather than a DataFrame. At least, from the example you gave, it sounds like a container where you have the expectation that each column is a NumericVector of equal length.</div>
<div><br></div><div>If you can make the switch to NumericMatrix, then you can generate and operate with row/column views, e.g. NumericMatrix::Row and NumericMatrix::Column, which will generate references to rows / columns and hence avoid copying. (These are generated whenever you do e.g. x(i, _) or x(_, i) on a NumericMatrix x).</div>
<div><br></div><div>-Kevin</div><div>
<div><div><br><div class="gmail_quote">On Tue, Feb 19, 2013 at 3:26 PM, Ken Williams <span dir="ltr"><<a href="mailto:Ken.Williams@windlogics.com" target="_blank">Ken.Williams@windlogics.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> From: John Merrill [mailto:<a href="mailto:john.merrill@gmail.com" target="_blank">john.merrill@gmail.com</a>]<br>
> Sent: Tuesday, February 19, 2013 5:24 PM<br>
> To: Ken Williams<br>
> Cc: Yan Zhou; Dirk Eddelbuettel; <a href="mailto:rcpp-devel@lists.r-forge.r-project.org" target="_blank">rcpp-devel@lists.r-forge.r-project.org</a><br>
<div>> Subject: Re: [Rcpp-devel] Efficient DataFrame access by row & column<br>
><br>
</div><div>> I'm a little puzzled by your question.  Could you use a reference instead of instantiating a new copy?<br>
<br>
</div>I would love to use a reference, but I don't know how.  That's in fact the essence of my question. =)<br>
<br>
Is there already some example code somewhere showing how to get reference to a DataFrame column without copying?  I must be just missing it.<br>
<div><div><br>
 -Ken<br>
<br>
<br>
________________________________<br>
<br>
CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of any kind is strictly prohibited. If you are not the intended recipient, please contact the sender via reply e-mail and destroy all copies of the original message. Thank you.<br>





_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org" target="_blank">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote></div><br></div></div></div>