Gabor Grothendieck wrote:
Not really. The point of this is that promises seem to be
screwing up in conjunction with [[ but in light of the fact
that .subset2 works it suggests that there might be a better
implementation of [[
Not really; .subset2() is a shortcut that bypasses method dispatch, so
Not really. The point of this is that promises seem to be
screwing up in conjunction with [[ but in light of the fact
that .subset2 works it suggests that there might be a better
implementation of [[.
Also some insight into what is really driving this problem
so one can more easily recognize it i
Dear Gabor:
Does the following answer your question:
> tst <- list(a=1, b=2)
> tst[numeric(0)]
list()
> tst[[numeric(0)]]
Error in tst[[numeric(0)]] : attempt to select less than one element
Spencer
Gabor Grothendieck wrote:
In the code below test2() gives an error message:
Er
In the code below test2() gives an error message:
Error in .subset2(x, i, exact = exact) :
attempt to select less than one element
even though test(), which is nearly the same, gives
the expected result. BOD is a data set that comes
with R. Is this a bug?
idx <- 2
# returns expected