From vdergachev at rcgardis.com  Wed Nov  8 23:36:44 2006
From: vdergachev at rcgardis.com (Vladimir Dergachev)
Date: Wed, 8 Nov 2006 17:36:44 -0500
Subject: [Rd] data frame subscription operator
In-Reply-To: <971536df0611080841h3350d9at3674bdc6139de4b6@mail.gmail.com>
References: <200611061950.09315.vdergachev@rcgardis.com>
	<200611081113.54152.vdergachev@rcgardis.com>
	<971536df0611080841h3350d9at3674bdc6139de4b6@mail.gmail.com>
Message-ID: <200611081736.45082.vdergachev@rcgardis.com>

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



[Rd] data frame subscription operator
Vladimir Dergachev