请试着在地图上为德克萨斯州休斯顿绘制不同的拉链码。我已经绘制了地图上显示为彩色圆圈的邮政编码。如何绘制地图上的实际邮政编码,以便在您悬停时在地图上显示或显示zipcodes的鼠标。?
library(ggplot2)
library(maps)
library(ggmap)
x1 <- as.character(data$zips)
lonlat_sample <- sapply(x1 , function(x1){as.numeric(geocode(x1))})
lonlat1 <- t(lonlat_sample)
complete1 <- data.frame(data,lonlat1)
colnames(complete1) <- c("zips", "ER","long","lat")
map <- get_map(location = "harris county", zoom=9)
mapPoints <- ggmap(map, fullpage=TRUE) +
geom_point(aes(x = long, y = lat, size = ER, col="class"), data = complete1, alpha = .8)
mapPoints