Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

thigmophobe

Find the direction away from the closest point


Description

Find the direction away from the closest point

Usage

thigmophobe(x,y=NULL,names=seq_along(z),xlog=par("xlog"),ylog=par("ylog"),
  usr=par("usr"),pin=par("pin"),eps=.Machine$double.eps,pi=base::pi)

Arguments

x,y

Numeric data vectors. Typically the x/y coordinates of plotted points. If arrays are passed, they will be silently coerced to numeric vectors.

names

Names for the vector of directions.

xlog,ylog

Flags for logarithmic axes. See Note.

usr

The extent of the plot in user units.

pin

Extent of the plot in inches.

eps

smallest number that can be represented on the system.

pi

value of pi.

Details

thigmophobe returns the direction (as 1|2|3|4 - see pos= in text) away from the nearest point to each of the points described by x and y.

Value

A vector of directions away from the point nearest to each point.

Note

thigmophobe is typically used to get the offsets to automatically place labels on a scatterplot or similar using thigmophobe.labels to avoid overlapping labels. The name means "one who fears being touched".

The plot.span, xlog and ylog arguments were added to allow thigmophobe to be used outside of base graphics.

Author(s)

Bill Venables

See Also

Examples

x<-rnorm(10)
 y<-rnorm(10)
 thigmophobe(x,y)

plotrix

Various Plotting Functions

v3.8-1
GPL (>= 2)
Authors
Jim Lemon, Ben Bolker, Sander Oom, Eduardo Klein, Barry Rowlingson, Hadley Wickham, Anupam Tyagi, Olivier Eterradossi, Gabor Grothendieck, Michael Toews, John Kane, Rolf Turner, Carl Witthoft, Julian Stander, Thomas Petzoldt, Remko Duursma, Elisa Biancotto, Ofir Levy, Christophe Dutang, Peter Solymos, Robby Engelmann, Michael Hecker, Felix Steinbeck, Hans Borchers, Henrik Singmann, Ted Toal, Derek Ogle, Darshan Baral, Ulrike Groemping, Bill Venables
Initial release
2021-01-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.