简体   繁体   English

R Studio Knitr PDF Markdown打印“ asis”

[英]R Studio Knitr PDF Markdown prints “asis”

I am generating a PDF document using Knitr. 我正在使用Knitr生成PDF文档。 I am calling my r script from a separate file. 我正在从一个单独的文件中调用我的r脚本。 Everything prints out fine in the PDF, but when I output a table using Stargazer, knitr generates a new page in the PDF document with "asis" printed on the page. 一切都可以在PDF中正常打印,但是当我使用Stargazer输出表格时,knitr会在PDF文档中生成一个新页面,页面上印有“ asis”。 I included a screen shot. 我提供了一个屏幕截图。 Any ideas why this is happening? 任何想法为什么会这样?

My code chunk: 我的代码块:

---
title: "PALS Biomarker Analysis"
author: "Daniel Parker"
date: "November 20, 2017"
output: pdf_document
header-includes:
- \usepackage{caption}
---

\captionsetup[table]{labelformat=empty}


```{r echo=FALSE}
library(knitr)
read_chunk('11-20-17 PALS Analysis V3.R')

```

```{r eighth, echo = FALSE,  results="asis"}
<<linear_model_one>>
```

If I remove the results="asis" the table does not print correctly. 如果我删除results =“ asis”,则表格无法正确打印。

在此处输入图片说明

Try changing this code 尝试更改此代码

```{r eighth, echo = FALSE,  results="asis"}
    <<linear_model_one>>
```

to this (remove the double quotes surrounding asis ) 为此(删除围绕asis的双引号)

```{r eighth, echo = FALSE,  results='asis'}
<<linear_model_one>>
```

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

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