## Plot points in one dimension
index <- rep(0, 100)
values <- rnorm(100)
plot(index, values, xlim = c(-0.5, 2.5))
points(swarmx(index + 1, values), col = 2)
points(swarmx(index + 2, values, cex = 1.5), col = 3, cex = 1.5)
## Try the horizontal direction, with a log scale
plot(values, index, log = 'x', ylim = c(-1, 2))
points(swarmy(values, index + 1), col = 2)
Run the code above in your browser using DataLab