Description Usage Arguments Details Value Author(s) See Also Examples
connects two sets of points with a dendrogram-like structure,
adds an arrowhead at a certain distance.
1 2 |
from |
matrix of coordinates (x,y) of points *from* which to draw arrow. |
to |
matrix of coordinates (x,y) of points *to* which to draw arrow. |
lwd |
line width. |
lty |
line type. |
lcol |
line color. |
arr.col |
arrow color. |
arr.side |
segment number on which arrowhead is drawn (1,2). |
arr.pos |
relative position of arrowhead on segment on which arrowhead is drawn. |
line.pos |
relative position of (horizontal/vertical) line. |
path |
Vertical, Horizontal. |
... |
other arguments passed to function straightarrow. |
a tree-shaped arrow is drawn between points '(from, to)',
where both from and to can be several points.
How the segments are drawn is set with path which can take on the
values:
"H": (horizontal): first left or right.
"V": (vertical): first down- or upward.
The segment(s) on which the arrow head is drawn is set with arr.side,
which is one or more values in (1, 2)
The position of the arrowhead on the segment on which it is drawn,
is set with arr.pos, a value between 0(start of segment) and
1(end of segment)
The type of the arrowhead is set with arr.type which can take the
values:
"none" : skips the drawing of arrows.
"simple" : uses comparable R function arrows.
"triangle": uses filled triangle.
"curved" : draws arrowhead with curved edges.
"circle" : draws circular head.
"ellipse" : draws ellepsoid head.
"T" : draws T-shaped (blunt) head.
The size of the arrow head can be specified with the arguments
arr.length and arr.width.
See Arrowhead from package shape for details
on arrow head.
coordinates (x,y) where arrowhead is drawn
Karline Soetaert <karline.soetaert@nioz.nl>
straightarrow, segmentarrow,
curvedarrow, selfarrow,
bentarrow, splitarrow,
arrows: the comparable R function,
Arrows: more complicated arrow function from package
shape.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | openplotmat(main = "treearrow")
pos <- coordinates(c(3, 2, 4, 1))
treearrow(from = pos[1:5, ], to = pos[6:10, ])
for (i in 1:10)
textrect(pos[i, ], lab = i, cex = 2, radx = 0.05)
openplotmat(main = "treearrow")
pos <- coordinates(c(2, 4), hor = FALSE)
treearrow(from = pos[1:2, ], to = pos[3:6, ],
arr.side = 1:2, path = "V")
for (i in 1:6)
textrect(pos[i, ], lab = i, cex = 2, radx = 0.05)
openplotmat(main = "treearrow")
pos <- coordinates(c(3, 5, 7, 7, 5, 3))
treearrow(from = pos[1:15, ], to = pos[15:30, ], arr.side = 0)
for (i in 1:30)
textrect(pos[i, ], lab = i, cex = 1.2, radx = 0.025)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.