I want to assign the means of x and y to a scatterplot in R without ggplot, just basic R. However, in the way I try (using abline), it does not illustrate the lines in the plot. I already had to do another task earlier, hence the slightly longer code.
I tried using abline for either x and y to assign a horizontal and a vertical dashed line to the plot. The result was that the plot inclusive the blue dot is illustrated, but the means don't show up.
plot(x, y, axes = TRUE, pch = 16, xlim = c(40,120)
points(46, 150, col = "blue", pch = 16), main = abline(v = mean(y), lty = 2, lwd = 4)
abline(h = mean(x), lty = 2, lwd = 4))