Because plot.default
doesn't have an add
argument
> args(plot.default)
function (x, y = NULL, type = "p", xlim = NULL, ylim = NULL,
log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL,
ann = par("ann"), axes = TRUE, frame.plot = axes, panel.first = NULL,
panel.last = NULL, asp = NA, ...)
NULL
Those other functions are not overriding plot
but are providing their own methods, which do have an argument add
because they were written that way. Personally, having grown up with using points()
and lines()
etc I don't find them much extra work and I would use them in preference to a plot
method with an add
argument, although we've written both ways in packages that I contribute to.
As to why plot.default
doesn't have an add
argument? You'd have to ask R Core, but I can suggest some reasons
plot.default
is designed to generate an entire plot on the device
- There already are
points()
and lines()
etc so why duplicate?
plot.default
is simpler code without code to handle add
- Backwards compatibility with S/S-Plus
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…