xy <- c(-3,-4,-3,0,-1,-2,-1,0,1,2,1,3,4,5,4,3)
dt <- c(1,1.5,2,1,1,1.5,2,2,1,1.5,2,1,1,1.5,2,2)
id <- c(rep("B1",3), rep("B2",5), rep("B3",3), rep("B4",5))
out <- octashift(xy, dt, id, pos = 3, clockwise = TRUE)
par(mfrow = c(2,1))
plot.new()
plot.window(xlim = range(xy) + c(-1, 1), ylim = range(dt) + 0.5 * c(-1, 1))
axis(1)
axis(2)
multilines(i = id, x = xy, y = dt)
plot.new()
plot.window(xlim = range(xy) + c(-1, 1), ylim = range(dt) + 0.5 * c(-1, 1))
axis(1)
axis(2)
multilines(i = out$i, x = out$x, y = out$y)
Run the code above in your browser using DataLab