试图在我的ggplot上添加标签,遇到错误:美学必须是长度1或与数据(4)相同:标签,x,y

时间:2017-11-09 16:40:48

标签: r ggplot2 ggmap

bboxsf <- make_bbox(SFstations$longitude, SFstations$latitude, f = .05)
mapsfscale <- get_map(bboxsf)

SFmapscale <- ggmap(mapsfscale) + geom_point(data = SFstations, aes(x =SFstations$longitude, y= SFstations$latitude, size=Freq), alpha =1.0) + geom_text(aes(label = SFstations$name),vjust=0, hjust= 0)

这是我上面的代码。我设法根据频率在地图上缩放我的点数。当我尝试添加标签时,虽然我收到错误

Aesthetics must be either length 1 or the same as the data (4): label, x, y.

0 个答案:

没有答案