我在R 笔记本上工作,想用它来创建两个输出:一个 HTML 文档和一个 PDF 文档。
我的分析包括传单地图(html 小部件),当我将笔记本编织成 PDF 文档时,这会导致问题。由于webshot
现在包含在knitr
包中的功能,“knitr 将尝试使用 webshot 包自动为 HTML 小部件生成静态屏幕截图”(https://github.com/yihui/knitr/blob/master/NEWS.md)。
当我的输出是一系列堆叠在一起的传单地图时,这很好用,但我想以更简洁的行排列将这些地图组合在一起(见下图)。
这是我的 R 笔记本的可重现示例:gist
不幸的是,当我尝试将其编入 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.
如何在 PDF 文档中获得这种单行排列?