library(stringr)
main_addresses=read.csv("Addresses.csv")
indian_addresses=subset(main_addresses,main_addresses$countries=="India")
indian_addresses$address<- gsub('[*/,.;#@`~!-]', ' ', indian_addresses$address)
write.csv(indian_addresses,file="Indian Addresses.csv")
## Loading required package: ggplot2
## [1] "Found temp file - resuming from index:"
## [1] 708
write.csv(data,file="Addresses_geocoded.csv")
addressplot<-na.omit(as.data.frame(cbind(data$lat,data$long)))
colnames(addressplot)<-c("lat","long")
mapgilbert <- get_map(location = c(lon = mean(addressplot$long), lat = mean(addressplot$lat)), zoom = 4,maptype = "satellite", scale = 2)
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=21.875495,74.538124&zoom=4&size=640x640&scale=2&maptype=satellite&language=en-EN&sensor=false
ggmap(mapgilbert) +
geom_point(data = addressplot, aes(x = long, y = lat, fill = "red", alpha = 0.8), size = 2, shape = 21) +
guides(fill=FALSE, alpha=FALSE, size=FALSE)
## Warning: Removed 14 rows containing missing values (geom_point).
View Indian Addresses in a full screen map