繁体   English   中英

加密的 R Markdown HTML 文件不显示图形?

[英]Encrypted R Markdown HTML file not displaying graphs?

我正在尝试加密使用 RMarkdown 创建的 HTML 文件。 我正在使用encryptedRmd package。

对于 markdown 文档,我有:

title: "My_Markdown"
output: 
  html_document:
    toc: true
    toc_float: true
    toc_depth: 2
    self_contained: yes

 #ggplots below

并且,将此 markdown 转换为加密版本:

library(encryptedRmd)

path = '//R_Scripts/My_Markdown.html'

encrypt_html_file(
  path,
  output_path = paste0(path, ".enc.html")
)

加密有效,我可以访问新的加密 HTML。 但是,加密版本中没有显示任何 ggplot,目录也没有显示。 带有数据的表格确实出现了。 test.html 文档出现了ggplots,所以我想知道为什么它没有翻译成加密版本?

我没有听说过 encryptRmd package,但看起来很有趣。 在创建.Rmd 时,如果在 yaml 中使用self_contained: yes会怎样? 这将使整个文档成为独立的,希望它对您有好的结果

output:
  html_document:
    self_contained: yes

我只是尝试了两种方式,我能够让 ggplot2 以两种方式显示。

encrypt_html_file("//R_Scripts/test.html", "//R_Scripts/test_enc.html"))

暂无
暂无

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

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