相关疑难解决方法(0)

Knit & rmarkdown::render() 产生不同的结果(kable 格式;PDF)

我有一些 Rmarkdown 文档我正在尝试knit/render作为PDF文件。我想要render正常工作,因为我将在具有多个 Rmd 文件以及许多其他进程(例如数据抓取和处理)的脚本中运行它。

使用该knit按钮会产生所需的结果。如果我使用rmarkdown::render表格布局就会变得古怪(参见示例)。这是重现我的问题的最小示例。

RMD

---
title: "RmdTest"
author: "TTS"
date: '`r format(Sys.time(), "%d %B, %Y")`'
output: pdf_document
always_allow_html: true
---

```{r Rmd-Setup, include=FALSE}
options(knitr.kable.NA = '')

library(kableExtra)

# Dummy Data
df <- structure(list(Location = c("Farm", "Farm", "Farm", "Farm"), 
    Animal = c("dog", "cat", "cat", "cat"), Age = c("Adult", 
    "Juvenile", "Adult", "Total"), Abundance = c(27269L, 62308L, 
    34904L, 97212L)), row.names = c(NA, -4L), class = "data.frame") …
Run Code Online (Sandbox Code Playgroud)

pdf r knitr r-markdown kableextra

5
推荐指数
1
解决办法
1669
查看次数

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.
Run Code Online (Sandbox Code Playgroud)

有人知道这意味着什么吗?

r rstudio knitr r-markdown

2
推荐指数
2
解决办法
4731
查看次数

标签 统计

knitr ×2

r ×2

r-markdown ×2

kableextra ×1

pdf ×1

rstudio ×1