【发布时间】:2014-06-15 22:28:59
【问题描述】:
我正在尝试将 ggmap 与 ggplotly 一起使用,但无法使这些包一起工作。搜索错误消息让我得到here。但是,我不确定 aes 继承是/可能是一个问题。奇怪的是,使用 ggmap 创建的“myPlot”在 RStudio 中工作得很好,但无法连接到 ggplotly。地图数据来自here。
这两个包可以一起工作吗? (顺便说一句,我不能把它标记为 ggplotly,我不认为这个包之前在 SO 上被引用过。)
代码
lapply(list("ggplot2", "ggmap", "mapproj", "RCurl", "RJSONIO", "plyr"),
require, character.only=TRUE)
# install.packages("devtools")
library("devtools")
# install_github("plotly", "ropensci")
library(plotly)
mapImageData1 <- get_map(location = c(lon = -0.016179, lat = 51.538525),
color = "color",
source = "google",
maptype = "satellite",
zoom = 17)
myMap = ggmap(mapImageData1,
extent = "device",
ylab = "Latitude",
xlab = "Longitude")
py <- plotly("RgraphingAPI", "ektgzomjbx")
res <- py$ggplotly(gg = p_map)
错误信息
res
【问题讨论】: