【问题标题】:Issue with ggmapsggmap 的问题
【发布时间】:2019-04-18 13:03:28
【问题描述】:

我正在运行以下代码:

map <- get_map(location = 'India', zoom = 4)

但出现以下错误:

来源: https://maps.googleapis.com/maps/api/staticmap?center=India&zoom=4&size=640x640&scale=2&maptype=terrain&language=en-EN&key=XXXXXX aperm.default(map, c(2, 1, 3)) 中的错误:第一个参数无效, 必须是数组

另外:警告信息:

在 get_googlemap(center = location, zoom = zoom, maptype = maptype, : HTTP 400 Bad Request

【问题讨论】:

标签: r ggmap


【解决方案1】:

面临同样的问题。我修复了它,使用纬度和经度作为位置。我使用 4 个坐标来定位位置。以下代码说明了如何解决此问题。

usa <- c(left = -125, bottom = 25.75, right = -67, top = 49)
get_map(usa, zoom = 4, maptype = "terrain") %>%
ggmap()

请注意:如果你试图重现上面的代码 sn-p.它需要安装“dplyr”和“ggmap”。有关如何使用 ggmap 的分步教程。 click here

【讨论】:

    猜你喜欢
    • 2020-09-24
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 2021-07-13
    • 1970-01-01
    • 2021-07-14
    • 2020-11-19
    • 2013-10-16
    相关资源
    最近更新 更多