Skip to content

Instantly share code, notes, and snippets.

@josephlewis
Created February 8, 2018 19:56
Show Gist options
  • Save josephlewis/7463b91f252355a226795b1f743c019a to your computer and use it in GitHub Desktop.
Save josephlewis/7463b91f252355a226795b1f743c019a to your computer and use it in GitHub Desktop.
for (i in 1:(nrow(road_coords)/2)) {
A <- unlist(road_coords[i,2:3])
B <- unlist(road_coords[i + 1,2:3])
> head(road_coords)
Name coords.x1 coords.x2
1 Margary 62aa 300409.3 229884.3
2 Margary 62aa 303385.8 231078.0
3 Margary 62b 300419.3 229884.6
4 Margary 62b 277120.8 234235.1
5 Margary 62c 276985.6 234293.7
6 Margary 62c 262312.3 251090.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment