当我试图通过Jupyter运行此:错误: “HTML控件不能以纯文本格式表示的”
library(leaflet)
m <- leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
m # Print the map
我得到这个错误:
HTML widgets cannot be represented in plain text (need html)
。
至于建议here我曾尝试:
library(plotly)
embed_notebook(m)
,但我得到:
Error in UseMethod("embed_notebook"): no applicable method for 'embed_notebook' applied to an object of class "c('leaflet', 'htmlwidget')
我怎么能画出这样的图呢?
#cromulent问题是'htmlwidgets :: saveWidget(m,“m.html”)'doesen't创建html文件。 – Simone
@Simone如果这是侮辱,我很抱歉,但是您的R版本中是否安装了htmlwidgets软件包?如果你这样做,我还没有足够的经验去了解可能导致问题的原因。 – cromulent
是的,我已经安装了'htmlwidgets'软件包 – Simone