0
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)

Here is my code above. I managed to scale my points on the map based off frequency. When I try to add labels though I am getting error of

Aesthetics must be either length 1 or the same as the data (4): label, x, y.
MrFlick
  • 195,160
  • 17
  • 277
  • 295
Marc Toney
  • 21
  • 4
  • It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data so we can run and test the code. It's a red flag to see `$` used in `aes()` but hard to tell if that's the problem for sure without a reproducible example. – MrFlick Nov 09 '17 at 16:43
  • Wow, thanks for the quick response MrFlick. I was able to solve it from viewing another problem similar. I believe my error was from not including my long/lat arguments in my geom_text call. This is came out as correct. SFmapscale <- ggmap(mapsfscale) + geom_point(data = SFstations, aes(x =SFstations$longitude, y= SFstations$latitude, size=Freq), alpha =1.0) + geom_text(data=SFstations, aes(x =SFstations$longitude, y= SFstations$latitude, label = SFstations$name)) – Marc Toney Nov 09 '17 at 16:44

0 Answers0