R Markdown多余的空白PDF输出

时间:2019-01-08 23:52:22

标签: r pdf r-markdown knitr

First

Second

Third

有人知道为什么R降价会在每个图上方生成过多的空白吗,我该如何解决?是否包括编织器选项?还是任何块选项?

我在这篇文章的底部提供了3张图片,以便您了解我的意思。

除了echowarningmessage之外,没有使用任何其他块选项,关于该图,它是一个基本的ggplot。

在注释中让我知道是否需要提供块的任何代码示例以获得更好的视图。

编辑:这是一个简单的rmarkdown文件,可在ggplots上方产生相同的多余空白。

---
title: "Untitled"
author: "Razvan Cretu"
date: "January 9, 2019"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r import, echo=FALSE}

library('ggplot2')

```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r cars}
summary(cars)
```

## Including Plots

You can also embed plots, for example:

```{r pressure, echo=FALSE}
ggplot(cars, aes(speed, dist))+
  geom_line()
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

0 个答案:

没有答案