geom_point从控制台运行,但不从R Markdown运行(编织html)

时间:2016-05-29 18:18:11

标签: r ggplot2 r-markdown

我有以下数据集

head(myDataFrame)
  rating      lat       lon
1    4.0 40.70952 -74.01460
2    3.8 40.70144 -74.01514
3    4.1 40.72795 -74.00139
4    4.1 40.71792 -73.99012
5    4.1 40.72706 -73.98855
6    4.1 40.71568 -74.00849

以及以下几点

geo
[1] "40.7127837"        "-74.0059413"       "New York, NY, USA"

当我从控制台运行以下功能时,它运行良好

showLocationsOnMap <- function(geo,myDataFrame) {
  map <- get_map(location = c( lon =as.numeric(geo[2]), lat = as.numeric(geo[1])), maptype = "satellite", zoom = 14)
  ggmap(map) + geom_point(data = myDataFrame, aes(x=lon, y=lat, color=rating)) + scale_colour_gradientn(colours=rainbow(4))
}

但是当我从R Markdown运行时,我收到以下错误

  

错误:ggplot2不知道如何处理类数字的数据另外:警告消息:1:包'RCurl'是在R版本3.2.4下构建的2:包'ggplot2'是在R版本3.2下构建的.4执行暂停

0 个答案:

没有答案
相关问题