arrow: Find coords for plotting horizontal arrows

View source: R/misc.R

arrowR Documentation

Find coords for plotting horizontal arrows

Description

Find coords for plotting horizontal arrows

Usage

arrow(
  tail,
  head,
  y,
  arrowLength = diff(graphics::par("usr")[1:2]) * 0.05,
  shaft = 0.2,
  point = 0.4,
  concat = TRUE
)

Arguments

tail

x coordinate for tail of the arrow

head

x coordinate for the head of the arrow

y

y position for middle of block

arrowLength

arrow length in usr coords

shaft

half of shaft thickness in usr coords

point

half of arrow thickness in usr coords

concat

logical indicating whether to concatenate multiple arrows into one data frame separated by NAs (e.g. ready for poly)

Value

a data.frame with columns x and y specifying coordinates for arrows

Examples

plot(1:10)
polygon(arrow(1:5,3:7*1.5,2:6))
polygon(arrow(3:6,1:4/1.5,7:10))
polygon(arrow(7:10,7:10+0:3*.1,7:10))
polygon(arrow(6:9,6:9-0:3*.1,7:10))

sherrillmix/dnar documentation built on July 18, 2022, 10:07 p.m.