Created
April 6, 2018 21:44
-
-
Save josephlewis/a4746293d093b86265527c3aaa9a3150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i in levels(scot_battles_centroid_dates$century)) { # the levels are "1200s" to "1900s" | |
battle_road_dist <- gDistance(scot_battles_centroid_dates[scot_battles_centroid_dates$century == i,], sp, byid = TRUE) # euclidean distance from battle point to road. | |
battle_road_dist_vect <- data.frame(as.vector(battle_road_dist)) # creates df of the distances | |
dist_test <- rbind(battle_road_dist_vect) # adds to a df to create one df with all of the distances | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment