Error with embed_notebook, getting plotly to work on Jupyter

和自甴很熟 提交于 2019-12-07 16:39:20

问题


I am trying to have embedded R plotly charts in Jupyter

I am following https://plot.ly/r/using-r-in-jupyter-notebooks/

But stuck at "Make sure that both pandoc.exe and pandoc-citeproc are available in your local python installation folder (or Jupyter environment if you have setup a separate environment)."

I found the pandoc.exe and pandoc-citeproc. But not sure on where to copy those files.

Based on the Anaconda Prompt my environment is C:\Users\myname\AppData\Local\Continuum\Anaconda2\ But even after copying the files there I still get the error of: "Error in embed_notebook(gg): x must be a plotly figure"

I also ran the command .libPaths() and added the files to that location and get the same error

Jupyter is working, I can make regular ggplot2 plots

p <- ggplot(data = test_df, aes(x = day, y = spend)) +
geom_point(aes(text = paste("Country:",country_level)), size = 4) +
geom_smooth(aes(colour = affiliate_country_level_3_name, fill = country_level)) + facet_wrap(~ country_level)

(gg <- ggplotly(p))


embed_notebook(gg)

I can plot p using ggplot alright

test_df is a data.frame, day: Date; country_level: Factor; spend is num

I installed Python using Anaconda. Please advise and let me know what else I can provide

Thank you

来源:https://stackoverflow.com/questions/35609768/error-with-embed-notebook-getting-plotly-to-work-on-jupyter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!