brace: Draw brace

braceR Documentation

Draw brace

Description

Draw brace

Usage

brace(x1 = 0, y1 = 0, x2 = 0, y2 = 1, right = TRUE, rad = 0.2, tip = FALSE)

brace_(...)

Arguments

x1

y1, x1, y2 endpoints of brace

right

(default TRUE) direction in which brace points

rad

(default 0.2) radius of curl of brace

tip

the tip of the brace (default FALSE)

Value

the coordinates of the point of the brace, invisibly

Functions

  • brace_(): default tip = TRUE

Author(s)

Georges Monette, Michael Friendly

Examples

plot(c(0,10), c(0,10), type = 'n')
lines(brace(0, 0, 0, 5), lwd = 2)
text(brace(0, 0, 0, 5, tip = T),"size", adj = c(-.1,.3))
lines(brace(2, 0, 8, 5, right = F), lwd = 2)
text(brace_(2, 0, 8, 5, right = F), 'tip')
text(brace_(2, 0, 8, 5, right = F), 'tip', adj = c(.5,-.3), col = 'red')
plot(c(0,10),c(0,1))
brace(5,0,5,1) %>% lines
lapply(1:10, function(x) {
   lines(brace(x,0,x,.1*x,F))
   lines(brace(x,0,x-.2*x,.1*x,F),col = 'red')
})

gmonette/spida2 documentation built on Aug. 11, 2024, 7:52 p.m.