R Markdown 编译错误:

标签 r rstudio knitr r-markdown

当我尝试将 Rmarkdown 文档编译为 pdf 时,出现此错误:

    Error: Functions that produce HTML output found in document targeting latex output.
Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:

  always_allow_html: yes

Note however that the HTML output will not be visible in non-HTML formats.

有谁知道这是什么意思?

最佳答案

您是否尝试过以下方法? (来自:https://bookdown.org/yihui/bookdown/html-widgets.html)

install.packages("webshot")
webshot::install_phantomjs()

它对我有用。另见:https://github.com/rstudio/bookdown/issues/440

关于R Markdown 编译错误:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42543206/

相关文章:

python - 可以像普通 R 代码一样从 knitr block 将 Python 代码发送到 RStudio 控制台吗?

r - gsub 在 for 循环中失败

r - 如何在 Rstudio Markdown 中使用全局环境中的对象

r - 使用 knitr::include_graphics 函数控制图形的放置

r - 在 R 中创建事件时间变量

r - 基本-T检验->分组因子必须具有准确的2个级别

r - "Set working directory to source file location"的命令

R markdown to PDF - 打印控制台输出

jupyter-notebook - 如何将 Rmd 文档转换为 jupyter 笔记本

r - Lyx/knitr 错误