windows.options(record=TRUE) tmp <- data.frame(x=1:5, y=rnorm(5)) plot(y ~ x, data=tmp, pch=16, cex=3, col=c('blue','red','green','salmon','hotpink')) plot( ~ x, data=tmp, pch=16, cex=3, col=c('blue','red','green','salmon','hotpink')) methods(plot) plot.data.frame <- function(x, ...) boxplot(x) plot( ~ x, data=tmp, pch=16, cex=3, col=c('blue','red','green','salmon','hotpink')) ## no difference ls() rm(plot.data.frame) ## turn on ess-tracebug and ess-developer ## add graphics with C-c d-a gr ## C-c d s the fake.plot.data.frame.r file into graphics ls() plot( ~ x, data=tmp, pch=16, cex=3, col=c('blue','red','green','salmon','hotpink')) ## the plot.formula method without a y variable calls the ## plot.data.frame method inside the namespace. It doesn't see the ## version in the global environment. C-c d s places the functions ## inside the namespace.