# path from case 1 to nearest pump.
euclideanPath(1)
# path from pump 1 to nearest case.
euclideanPath(NULL, 1)
# path from case 1 to pump 6.
euclideanPath(1, 6)
# exclude pump 7 from consideration.
euclideanPath(1, -7)
# path from case 1 to case 6.
euclideanPath(1, 6, type = "cases")
# path from pump 1 to pump 6.
euclideanPath(1, 6, type = "pumps")
# compute multiple cases.
lapply(1:3, euclideanPath)
# plot path
plot(euclideanPath(1))
Run the code above in your browser using DataLab