decollide: Function decollide

decollideR Documentation

Function decollide

Description

Returns a matrix with coordinates and text for plotting texts without collisions.

Usage

decollide(
  x,
  y,
  text,
  jitter = F,
  cex = 1,
  font = 1,
  frame = 1.5,
  plot = F,
  lock.x = F,
  lock.y = F,
  verbose = F,
  repetitions = 100
)

Arguments

x

Numeric vector containing x-coordinates of text elements.

y

Numeric vector containing x-coordinates of text elements.

text

Character vector containing text-elements to be plotted.

jitter

Logical value specifying whether to add a small random component after each step.

cex

Numeric value specifying the maximum number of steps. Defaults to 100.

frame

Numeric value specifying the relative font size of an invisible frame around the text. Defaults to 1.5

lock.x

Logical value specifying whether to skip shifts on the x-axis. Defaults to F.

lock.y

Logical value specifying whether to skip shifts on the y-axis. Defaults to F.

verbose

Logical value specifying whether to give information on the process after each step.

Details

Returns a matrix with coordinates and text for plotting texts without collisions. Iteratively shifts text elements until all collisions are eliminated or the maximum number of repetitions is reached.

Examples

set.seed(0);decollide(x=rnorm(10),y=rnorm(10),text=paste0(1:10,":",round(rnorm(10),3)),cex=1,font=1,plot=T)

AndreasFischer1985/quantqual documentation built on June 20, 2022, 4:55 p.m.