<div dir="ltr">I'm a little puzzled by your question.  Could you use a reference instead of instantiating a new copy?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 19, 2013 at 3:19 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"><div class="im"><br>
<br>
> -----Original Message-----<br>
> From: Yan Zhou [mailto:<a href="mailto:zhouyan@me.com">zhouyan@me.com</a>]<br>
> Sent: Tuesday, February 19, 2013 5:10 PM<br>
> To: Dirk Eddelbuettel<br>
> Cc: Ken Williams; <a href="mailto:rcpp-devel@lists.r-forge.r-project.org">rcpp-devel@lists.r-forge.r-project.org</a><br>
> Subject: Re: [Rcpp-devel] Efficient DataFrame access by row & column<br>
><br>
> The most inefficient part I see is the creation of a new NumericVector inside<br>
> the inner most loop. You copied each column n times, of which n-1 times are<br>
> unnecessary.<br>
<br>
</div>That's what I suspected.  So is there no way to access elements of a DataFrame without copying columns to a new vector first?<br>
<span class="HOEnZb"><font color="#888888"><br>
 -Ken<br>
</font></span><div class="im HOEnZb"><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>

</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">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>