如何在一个块中包含R Markdown块的所有输出?

时间:2017-02-21 10:59:42

标签: r markdown knitr r-markdown

当我在RMarkdown中使用knitr评估代码块时,会有代码与输出分隔的空格。

例如,如果我评估以下块:

# I want to remove the white separations from the following chunk output

1+1

2+4

然后我在文档中收到以下输出(注意空白行)

enter image description here

我真正想要的是这样,代码和输出都包含在一个格式化的代码块中。

# I want to remove the white separations from the following chunk output

1+1

## [1] 2

2+4

## [1] 6

如何让块输出没有空白空格?

注意:我希望所有输出都在代码之后,如果我包含chunk选项results = "hold"会发生。我需要每行的输出直接在生成该行的代码之后。

0 个答案:

没有答案