我想把这些点放在谷歌地图上,但最后一行总是有问题:
p <- get_map(location = 'Illinois',zoom = 8)
ggmap(p)
# this line will have error,thanks
p + geom_point(data=lat_long, aes(long, lat),color = 'red',size =3)
Error in Ops.raster(p, geom_point(data = lat_long, aes(long, lat), color = "red", : operator not meaningful for raster objects
答案 0 :(得分:1)
您没有提供可重现的示例,也没有显示您正在使用的软件包。我会这样做:
library(dismo)
g <- gmap("Illinois")
x <- geocode("Springfield, Illinois")
plot(g, interpolate=T)
points(Mercator(x[1, c("longitude", "latitude")]), pch=20, col="red", cex=2)