Re: [R] Bug? plot.formula does need support plot.first / plot.last param in plot.default

2024-07-07 Thread Erez Shomron
Thank you Ivan, Yes I meant `panel.first`. I fumbled the title and the examples, but the end result is the same: ``` # Works with(mtcars, plot(wt, mpg, panel.first = { arrows(3, 15, 4, 30) })) # Doesn't work plot(mpg ~ wt, data = mtcars, panel.first = { arrows(3, 15, 4, 30) }) ``` I

Re: [R] Bug? plot.formula does need support plot.first / plot.last param in plot.default

2024-07-06 Thread Ivan Krylov via R-help
В Fri, 05 Jul 2024 14:35:40 +0300 "Erez Shomron" пишет: > This works as expected: > with(mtcars, plot(wt, mpg, plot.first = { > plot.window(range(wt), range(mpg)) > arrows(3, 15, 4, 30) > })) I think you meant panel.first, not plot.first. At least I cannot find any mention of

Re: [R] Bug? plot.formula does need support plot.first / plot.last param in plot.default

2024-07-06 Thread Erez Shomron
Thanks for your answer. Should I report in Bugzilla at least so it's tracked? I can point that the issue is with line 6 of the function body: ``` dots <- lapply(m$..., eval, md, eframe) ``` I assume the intention was to evaluate the arguments with the context of data passed to the

Re: [R] Bug? plot.formula does need support plot.first / plot.last param in plot.default

2024-07-05 Thread Duncan Murdoch
That definitely looks like a bug, but not one that anyone will be eager to fix. It's very old code that tried to be clever, and that's the hardest kind of code to fix. Remember Kernighan's Law: "Everyone knows that debugging is twice as hard as writing a program in the first place. So if

[R] Bug? plot.formula does need support plot.first / plot.last param in plot.default

2024-07-05 Thread Erez Shomron
Is the following a bug in your opinion? I think so. This works as expected: ``` with(mtcars, plot(wt, mpg, plot.first = { plot.window(range(wt), range(mpg)) arrows(3, 15, 4, 30) })) ``` This does not. ``` plot(mpg ~ wt, data = mtcars, plot.first = { plot.window(range(wt),