I would like to add points manually to a plot (through mouse clicks) and then generate coordinate data from those points.
Is there a package or a set of functions that would let me do this in R?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the base function
locator()to do this. Try the following, for example:locator()is often useful when you need to precisely place something — text or a legend, say — onto a plot in which the coordinate system of the plot isn’t easy to read off of the axes. For instance, try this, clicking once before returning to the command-line: