Guest User

Untitled

a guest
Nov 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. country_and_individuals.over <- over(countryPolygons, individuals.df, returnList = TRUE)
  2. country_and_individuals.df <- ldply(country_and_individuals.over, data.frame)
  3.  
  4. > head(country_and_individuals.df)
  5. .id individual_ID
  6. 1 0 5473277
  7. 2 0 3054526
  8. 3 0 3476794
  9. 4 0 4456345
  10. 5 0 1930378
  11. 6 0 1345628
  12.  
  13. countryPolygons.df <- as.data.frame(countryPolygons)
  14.  
  15. countryPolygons.df$.id <- as.numeric(rownames(countryPolygons.df))
  16.  
  17. individuals_and_regions.df <- merge(country_and_individuals.df, countryPolygons.df, by.x = ".id", by.y = ".id")
Add Comment
Please, Sign In to add comment