Learn R Programming

berryFunctions (version 1.22.5)

locatorRS: locator with immediate points in Rstudio

Description

Have locator add points on the graph directly after clicking, even in Rstudio Graphics devices

Usage

locatorRS(n = 512, type = "p", ...)

Value

List with x and y

Arguments

n

Maximum number of points to plot.

type

As in locator, but passed to points. DEFAULT: "p"

...

Further arguments passed to points

Author

Berry Boessenkool, berry-b@gmx.de, Dec 2020

See Also

Examples

Run this code
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
}

Run the code above in your browser using DataLab