ITPub博客

首页 > 大数据 > 可视化 > R 如何把ployly生成的图表保存成html

R 如何把ployly生成的图表保存成html

可视化 作者:self_control 时间:2016-03-18 16:03:42 1 删除 编辑
来源 :https://github.com/ropensci/plotly/issues/294

You can save a plot as standalone HTML with htmlwidgets::saveWidget(), but for reasons discussed here, plotly objects are not htmlwidget objects, so you'll have to convert the plotly object to an htmlwidget object with as.widget(), for example.

library(plotly) p <- plot_ly(mtcars, x = mpg, y = disp, mode = "markers") htmlwidgets::saveWidget(as.widget(p), "index.html")

Another option is to use Export -> Save as Web Page in the RStudio viewer

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30066956/viewspace-2059589/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: UNICODE码转汉字
请登录后发表评论 登录
全部评论

注册时间:2014-12-16

  • 博文量
    49
  • 访问量
    406895