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 a drop-in replacement for "[[". You also have

> test3 <- function(pf = parent.frame()) "[[.data.frame"(BOD, pf$idx)
> test3()
[1]  8.3 10.3 19.0 16.0 15.6 19.8


Something appears not quite right, but an easy workaround is to force the promise:

> test4 <- function(pf = parent.frame()) {pf;BOD[[pf$idx]]}
> test4()
[1]  8.3 10.3 19.0 16.0 15.6 19.8



--
  O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
 c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED])              FAX: (+45) 35327907

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to