Re: [Rd] data frame subscription operator

From: Vladimir Dergachev <vdergachev_at_rcgardis.com>
Date: Wed 08 Nov 2006 - 22:36:44 GMT

On Wednesday 08 November 2006 11:41 am, Gabor Grothendieck wrote:
> .subset and .subset2 are equivalent to [ and [[ except that
> dispatch does not take place. See ?.subset
>

Thank you Gabor !

I made an experiment and got rid of

 class(x) <- attr(x, "row.names") <- NULL

 while replacing all occurrences of x[ and x[[ with .subset and .subset2 .

 Results:

    X<-A[,1] is now instantaneous, as it should be.

    X<-A[1,1] is faster for data frames with many columns, but still appears to make a copy of A[,1] before indexing. Not sure why..

                 thank you

                    Vladimir Dergachev

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Nov 09 17:12:59 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 09 Nov 2006 - 07:30:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.