Hier ist ein Arbeitsbeispiel, wie man das mit dem rgdal-Paket macht. Es gibt viele andere Möglichkeiten, dies zu tun. Ich habe einen Link zur Verfügung gestellt, wo Sie eine Toronto Shape-Datei erhalten können, wenn Sie noch keine haben. Wenn Sie irgendwelche Fragen haben, lassen Sie es mich wissen.
library(rgdal)
myTestDF <- data.frame(MyDate = c("A","Toronto","C"),
latitude = c(74.3224,43.686094, 88.9237),
longitude = c(66.2222, -79.401350, -49.0074))
setwd("C:/WhereShapeFilesAre")
#Download shape file from open data site and unzip contents into a folder this example uses the wgs84 format.
#http://www1.toronto.ca/wps/portal/contentonly?vgnextoid=c1a6e72ced779310VgnVCM1000003dd60f89RCRD&vgnextchannel=75d6e03bb8d1e310VgnVCM10000071d60f89RCRD
TorontoShape<- readOGR(".", "citygcs_regional_mun_wgs84")
myTestPoints <- myTestDF
coordinates(myTestPoints) <- ~ longitude + latitude
proj4string(myTestPoints) <- proj4string(TorontoShape)
cbind(myTestDF, over(myTestPoints, TorontoShape))
Werfen Sie einen Blick auf das Paket ggmap und die Funktion 'geocode' oder' revgeocode'. Dies könnte für Sie funktionieren. – Dave2e