width for loop body, in current plotting units (can be a vector).
col
loop body color (can be a vector).
border
loop border color (can be a vector).
lty
loop border line type (can be a vector).
offset
offset for origin point (can be a vector).
edge.steps
number of steps to use in approximating curves.
radius
loop radius (can be a vector).
arrowhead
boolean; should arrowheads be used? (Can be a vector.)
xctr
x coordinate for the central location away from which loops should be oriented.
yctr
y coordinate for the central location away from which loops should be oriented.
...
additional arguments to polygon.
Details
network.loop is the companion to network.arrow; like the latter, plot elements produced by network.loop are drawn using polygon, and as such are scaled based on the current plotting device. By default, loops are drawn so as to encompass a circular region of radius radius, whose center is offset units from x0,y0 and at maximum distance from xctr,yctr. This is useful for functions like plot.network, which need to draw loops incident to vertices of varying radii.
Value
None.
Note
network.loop is a direct adaptation of gplot.loop, from the sna package.
#Plot a few polygons with loops
plot(0,0,type="n",xlim=c(-2,2),ylim=c(-2,2),asp=1)
network.loop(c(0,0),c(1,-1),col=c(3,2),width=0.05,length=0.4,
offset=sqrt(2)/4,angle=20,radius=0.5,edge.steps=50,arrowhead=TRUE)
polygon(c(0.25,-0.25,-0.25,0.25,NA,0.25,-0.25,-0.25,0.25),
c(1.25,1.25,0.75,0.75,NA,-1.25,-1.25,-0.75,-0.75),col=c(2,3))