rmarkdown评论或类似的东西

时间:2017-03-04 01:39:10

标签: comments warnings r-markdown

enter image description here

当编织rmarkdown文件时,标题区域后面会有一些内容,如图所示。

如何删除这些?

我在r代码块中设置了“warning = FALSE,comment = NA”,但它不起作用。

部分代码如下:

---
title: 'Validness Report by All Facilities'
subtitle: '2017-01-03 to 2017-01-09'
output: pdf_document
geometry: margin=0.5in
classoption: landscape
documentclass: article
---


```{r input, echo = FALSE, results = 'hide', cache = TRUE, 
warning=FALSE, comment=FALSE, error=FALSE}

setwd("F:/")
dfDataIn_valid2 <- read.csv("full_valid.csv", stringsAsFactors = FALSE)
```


```{r validness, echo = FALSE, results = 'hide', 
cache = TRUE, warning=FALSE, comment=FALSE, error=FALSE}



# Check if required packages are installed. If not, install them.

packages <- c("rJava", "xlsxjars", "xlsx", "lubridate", "dplyr", "lazyeval")
lapply(packages, library, character.only = TRUE)

```

1 个答案:

答案 0 :(得分:0)

您需要将chunk选项message设置为FALSE

```{r, echo = FALSE, results = 'hide', cache = TRUE, warning=FALSE, comment=FALSE, error=FALSE, message=FALSE)}

此外,您不需要为每个块重复选项;你也可以在第一个中设置它们:

```{r}
library(knitr)
opts_chunk$set(echo = FALSE, results = 'hide', cache = TRUE, warning=FALSE, comment=FALSE, error=FALSE, message=FALSE)
```