[Rcpp-devel] Efficient DataFrame access by row & column

John Merrill john.merrill at gmail.com
Wed Feb 20 00:23:33 CET 2013


I'm a little puzzled by your question.  Could you use a reference instead
of instantiating a new copy?


On Tue, Feb 19, 2013 at 3:19 PM, Ken Williams
<Ken.Williams at windlogics.com>wrote:

>
>
> > -----Original Message-----
> > From: Yan Zhou [mailto:zhouyan at me.com]
> > Sent: Tuesday, February 19, 2013 5:10 PM
> > To: Dirk Eddelbuettel
> > Cc: Ken Williams; rcpp-devel at lists.r-forge.r-project.org
> > Subject: Re: [Rcpp-devel] Efficient DataFrame access by row & column
> >
> > The most inefficient part I see is the creation of a new NumericVector
> inside
> > the inner most loop. You copied each column n times, of which n-1 times
> are
> > unnecessary.
>
> That's what I suspected.  So is there no way to access elements of a
> DataFrame without copying columns to a new vector first?
>
>  -Ken
>
> ________________________________
>
> 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.
> _______________________________________________
> 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/20130219/3b675b58/attachment.html>


More information about the Rcpp-devel mailing list