Code snippets defining ranges based on points located on a plot
The function returns snippets of code that you can paste in your script after you select points on a plot. Useful for defining areas on a map. The default methods assume that you will first click in the bottom left and then in the bottom right corner.
shaper(f = "p", n = 2, round = 2, ...)
f |
( |
n |
( |
round |
( |
... |
arguments passed to the |
For certain methods ("m" and "e") the function returns a matrix or extent class object if the function output is assigned to a name.
# plot something
data(dems)
mapplot(dems[1], col="earth")
# click 5 times to get the long-lat coords of 5 points
# shaper("m",5)
# example output:
mat <- matrix(c(
-2.89, 31.55,
3.32, 26.99,
21.17, 17.87,
33.6, 11.03,
5.65, 19.39
), ncol=2, byrow=TRUE)
#plot them
points(mat)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.