On Thu, 9 Dec 2021 15:47:02 +0100
Martin Maechler <maech...@stat.math.ethz.ch> wrote:

> What you should take from there:
> Do work with *both*
>     missing(drop)
> and
>     nargs()
> 
> (and more)
> in order to distinguish m[i] from m[i,] etc

Thanks for the advice! `[<-.data.frame` does make for enlightening
reading. 

I've also considered editing the call, like lm() does:

`[<-.foo` <- function(x, i, ..., value) {
        cl <- match.call(expand.dots = FALSE)
        cl[[1L]] <- quote(`[`)
        cl$value <- NULL
        x.subset <- eval(cl, parent.frame())
        # ... checks on x.subset ...
        NextMethod()
}

...but that fails _some_ of my tests (but not others) with "object
`*tmp*` not found"). Non-standard evaluation is probably not the answer
here. I'll have to handle the forms of the call with different nargs()
manually and separately.

-- 
Best regards,
Ivan

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to