Creating base_layer for ggmap not recognizing data.frame

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 18:51:10

The solution seems to be to use %+% on the ggplot item that is created from the ggmap call, rather than including base_layer in the original call to ggmap. This bypasses the code problem that @baptiste identified.

To implement this solution, copy in the following code in place of the #create the map object in my original question:

# create the map object
  if (is.null(data.in)){
    base.map <- ggmap(base.map.in)
  } else {    
    base.map <- ggmap(base.map.in ) %+% data.in + aes(x = LONG,
                                                      y = LAT)
  }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!