Hello,
There are two things that need to be pointed out here:
- There is no need to use the
+
sign (that's for ggplot). You should just add the points()
function below the plot as it will add to it automatically (that's what's generating the integer(0)
)
- In the base R plot, the canvas of the plot is decided when the
plot
function is used first based on the initial data (or specific arguments specified). All data added later that falls out of the initial canvas will not be visible as the canvas does not resize based on new data
Here is an example that works:
k<-5
z <- 0.5
plot(1:10, runif(10))
points(k,z,pch=19,col="blue",cex=5)

Here is one that won't show the blue dot as it falls outside the initial canvas
k<-5
z <- 5
plot(1:10, runif(10))
points(k,z,pch=19,col="blue",cex=5)
Most people use ggplot these days as it has a much more flexible, powerful and user-friendly style of coding. here are some resources if needed:
http://www.cookbook-r.com/Graphs/
Hope this helps,
PJ