Re: [R] Forwarding missing arguments to the `[` method

2021-12-08 Thread Bert Gunter
I haven't followed this thread, so this may be stupid, but have you looked at the do.call(`[`,...) idiom? Something like: x <- array(1:8, c(2,2,2)) > x , , 1 [,1] [,2] [1,]13 [2,]24 , , 2 [,1] [,2] [1,]57 [2,]68 > l <- as.list(rep(TRUE, 2)) > do.call(

Re: [R] Forwarding missing arguments to the `[` method

2021-12-08 Thread Ivan Krylov
Got some progress on this, but still not sure how to continue. First, a much more simple script reproducing the behaviour that confuses me: foo <- function(x, ...) structure(x, class = 'foo') `[.foo` <- function(x, i, ..., drop = TRUE) { print(sys.call()) print(match.call())