pasteLoc: Get coordinates on plot

Description Usage Arguments Value Examples

View source: R/plot.R

Description

Get coordinates on a plot by mouse-clicking.

Usage

1
pasteLoc(nb, digits = c(3, 3))

Arguments

nb

Number of positions.

digits

2 integer indicating the number of decimal places (respectively for x and y coordinates).

Value

A list of coordinates. Note that if you don't put the result in a variable, it returns as the command text for generating the list. This can be useful to get coordinates by mouse-clicking once, but then using the code for convenience and reproducibility.

Examples

1
2
3
4
5
6
7
## Not run: 
plot(runif(20, max = 5000))
# note the negative number for the rounding of $y
coord <- pasteLoc(3, digits = c(2, -1))
text(coord, c("a", "b", "c"))

## End(Not run)

bigstatsr documentation built on April 5, 2021, 5:08 p.m.