Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- country_and_individuals.over <- over(countryPolygons, individuals.df, returnList = TRUE)
- country_and_individuals.df <- ldply(country_and_individuals.over, data.frame)
- > head(country_and_individuals.df)
- .id individual_ID
- 1 0 5473277
- 2 0 3054526
- 3 0 3476794
- 4 0 4456345
- 5 0 1930378
- 6 0 1345628
- countryPolygons.df <- as.data.frame(countryPolygons)
- countryPolygons.df$.id <- as.numeric(rownames(countryPolygons.df))
- 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