[Rd] data frame subscription operator

Vladimir Dergachev vdergachev at rcgardis.com
Wed Nov 8 23:36:44 CET 2006


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



More information about the R-devel mailing list