gpt4 book ai didi

html - 将绘图保存为 html

转载 作者:行者123 更新时间:2023-12-02 14:49:21 25 4
gpt4 key购买 nike

我沿着这条线创建了一个情节:

http://www.buildingwidgets.com/blog/2015/7/2/week-26-sunburstr

# devtools::install_github("timelyportfolio/sunburstR")

library(sunburstR)

# read in sample visit-sequences.csv data provided in source
# https://gist.github.com/kerryrodden/7090426#file-visit-sequences-csv
sequence_data <- read.csv(
paste0(
"https://gist.githubusercontent.com/kerryrodden/7090426/"
,"raw/ad00fcf422541f19b70af5a8a4c5e1460254e6be/visit-sequences.csv"
)
,header=F
,stringsAsFactors = FALSE
)

在 Rstudio 中,我可以在查看器中单击:“导出 > 另存为网页 ...”

然后将绘图保存为交互式 html 文档。我想将此作为代码的一部分。如何使用 R 代码将绘图保存为 html?有很多 PDF/jpg 等示例,但没有 html。

最佳答案

将旭日图存储在变量中并使用 htmltools::save_html 保存它。

plot <- sunburst(sequence_data)

htmltools::save_html(plot, file = "C:/Users/User/Desktop/sunburst.html")

关于html - 将绘图保存为 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56650336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com