Thanks again! BTW, how did you find the code for [.default? I tried:
get([.default)
Error in get(x, envir, mode, inherits) : variable [.default was not
found
-Original Message-
From: Gabor Grothendieck [mailto:[EMAIL PROTECTED]
Sent: Monday, May 09, 2005 9:46 PM
To: Vadim
[.default is implemented in R as .subset. See ?.subset and note that
it begins with a dot. e.g. for the case where i and j are not missing:
[.lwdf - function(x, i, j) lapply(.subset(x,j), [, i)
On 5/8/05, Vadim Ogranovich [EMAIL PROTECTED] wrote:
Hi,
Encouraged by a tip from Simon
Hi,
Encouraged by a tip from Simon Urbanek I tried to use the S3 machinery
to write a faster version of the data.frame class.
This quickly hits a snag: the [.default(x, i) for some reason cares
about the dimensionality of x.
In the end there is a full transcript of my R session. It includes the
Vadim,
On May 8, 2005, at 2:09 PM, Vadim Ogranovich wrote:
# the naive [.lwdf = function (x, i, j) lapply(x[j], function
(col) col[i])
Umm... what about his:
[.lwdf = function(x, i, j) { r-lapply(lapply(j,function(a) x
[[a]]),function(x) x[i]); names(r)-names(x)[j]; r }
The subsetting operates