简体   繁体   English

为非R用户导出RBokeh图

[英]Exporting RBokeh Plot for Non-R Users

I have created an interactive plot in R using the RBokeh package. 我已经使用RBokeh包在R中创建了一个交互式图。 How do I save it so that it is a file that non R users can open and use? 如何保存它,使其成为非R用户可以打开和使用的文件? So basically currently I can hover my cursor over points in the plot and other information pops up for each data point making it interactive. 因此,基本上当前我可以将光标悬停在绘图中的点上,并且针对每个数据点都会弹出其他信息,从而使其具有交互性。 I want to keep that format instead of just saving it as a picture. 我想保留这种格式,而不仅仅是将其保存为图片。

Any help would be greatly appreciated, thanks! 任何帮助将不胜感激,谢谢!

Sample code: 样例代码:

install.packages("stringi")
install.packages("devtools")
library(devtools)

devtools::install_github("ramnathv/htmlwidgets")
devtools::install_github("bokeh/rbokeh")
library(rbokeh)
head(iris)
p <- figure() %>%
  ly_points(Sepal.Length, Sepal.Width, data = iris,
            color = Species, glyph = Species,
            hover = list(Sepal.Length, Sepal.Width))
p

Just figured it out. 只是想通了。 You can save it as an html file on your desktop and then you can email that file to whoever you please. 您可以将其另存为html文件,然后将其通过电子邮件发送给您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM