I am trying to geolocate a list of >1,000 of Indian institutions / NGOs / Universities etc. However, I only have the names and states of these. What I am looking for is an output that gives me
(1) a location in India
(2) some measure of how precise the search for the institution was, e.g. whether google maps had multiple results when searching for it
Unfortunately, at the moment my search did geocode many locations as being in the U.S., even though I added the state's name and "India" to the geocode call.
# load world map and packages library("rnaturalearth") library("rnaturalearthdata") library("ggplot2") world <- ne_countries(scale = "medium", returnclass = "sf") # Sample Data dta <- data.frame(1:9) dta$name <- c("Arunodaya Rural Integrated & Social Education Society , Andhra Pradesh , India" ,"Pathari Vocational Institute , Assam , India" ,"Mendu rural Devalopment Society , Andhra Pradesh , India" ,"Rural Health Care Development Society , Andhra Pradesh , India" ,"K.G.N.Voluntary Organisatin , Andhra Pradesh , India" ,"Prakashmay Sevashram , Bihar , India" ,"Integrity Explosion , Andhra Pradesh , India" ,"Sri Prakash Vidyaniketan , Andhra Pradesh , India" ,"Gayatri Vidya Parishad College of Engineering , Andhra Pradesh , India") #-------- # geocode data using Google Maps (Indian extension) geo <- geocode(dta$name, ext="co.in") # remove missings geo <- geo[!is.na(geo$lon),] # plot data: geo <- st_as_sf(geo, coords = c("lon","lat")) st_crs(geo) <- st_crs(world) # plot data ggplot() + geom_sf(data = world) + geom_sf(data = geo)