locatorRS {berryFunctions}  R Documentation 
Have locator
add points on the graph directly after clicking, even in Rstudio Graphics devices
locatorRS(n = 512, type = "p", ...)
n 
Maximum number of points to plot. 
type 

... 
Further arguments passed to 
List with x and y
Berry Boessenkool, berryb@gmx.de, Dec 2020
https://stackoverflow.com/q/65147219/1587132
if(interactive()){
plot(1:10, type="n")
locs < locator(n=3, type="o") # click on locations in graph.
# If you do not set n at beginning, press ESC to finish
locs
# In Rstudio, points only appear after finishing.
locatorRS(7, col="blue", type="o") # plots after each click
}