如何使用 GGMAP 在空间可视化中绘制矢量数据?

How do I plot a vector data in a spatial visualization, using GGMAP?

我在尝试使用包 ggmap.

对我的数据进行空间可视化时遇到了一些问题

I already have:

  1. ggmap 包裹
  2. Lat_lon 我的公司
  3. 我的 250 位客户中的
  4. Lat_lon

我想在我的城市地图上用绿色标出我的业务,​​用红色标出我的客户。

Here's my code atm:

您的一些客户似乎离您的公司很远。因此,您必须使用适当的缩放级别;在您的情况下 zoom=3 将包括大多数数据点。有:

library(ggplot2)
library(ggmap)

rp <- get_map(location = 'Ribeirao Preto', zoom = 3, maptype = 'satellite', color = "bw")

ggmap(rp) +
  geom_point(data = dados_empr, aes(x = lon, y = lat), color = 'red', size = 2, shape=19, alpha=0.5) +
  geom_point(data = dados_grnd,  aes(x = lon, y = lat), color = 'green', size = 3, shape=19)

我得到: