![](/img/trans.png)
[英]Is ggmap broken? Basic qmap() produces “arguments imply differing number of rows: 0,1”
[英]ggmap / ggplot error when plotting points on a ggmap: [arguments imply differing number of rows]
以下代码工作正常:
library(ggmap)
mp2 <- ggmap::get_map(location="South America", zoom = 4, source="google")
ggmap(mp2) +
geom_point(aes(c(-60), c(-1)), size=15) # plot one single point on map
产生这个:
虽然以下因某些原因不会出现预期的情况:
ggmap(mp2) +
geom_point(aes(c(-60, -65, -62), c(-1, -5, -10)))
给我以下错误:
Error in data.frame(x = c(-60, -65, -62), y = c(-1, -5, -10), PANEL = c(1L, :
arguments imply differing number of rows: 3, 4
这应该工作
df <- data.frame(lon=c(-60, -65, -62), lat = c(-1, -5, -10))
ggmap(mp2) +
geom_point(aes(x = lon, y = lat), size = 10, data = df)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.