When I draw grid lines on a plot using abline() the grid lines are drawn over the data.
abline()
Is there a way to draw the abline() lines behind
The panel.first argument of plot() can take a list or vector of functions so you can put your abline() calls in there.
panel.first
plot()
plot(1:4, panel.first = c(abline(h = 1:4, lty = 2, col = 'grey') ,abline(v = 1:4, lty = 2, col = 'grey')))