R/a_get_relative.R

Defines functions a_get_relative

a_get_relative <-
function(x, y){
coords <-par('usr')
dinps  <-par('pin')
xr <- abs(diff(coords[1:2]))
yr <- abs(diff(coords[3:4]))
xtox   <- dinps[1]/dinps[2]
x <- (x-coords[1])/xr
y <- (y-coords[3])/yr
x  <- x*xtox
cbind(x, y)
}

Try the pBrackets package in your browser

Any scripts or data that you put into this service are public.

pBrackets documentation built on May 2, 2019, 7:02 a.m.