R Markdown:将图形放在单独的页面上并横向定位

R Markdown: putting figure on separate page and with landscape positioning

我想在 R Markdown 中插入一个图形。我想让这个数字成为整个页面并平放(横向)。

这是我的代码:

# lots of text...
{r pressure, echo=FALSE, fig.cap="Fig. 1: Treatment durations...", out.width = '100%'}
knitr::include_graphics("E:/CZ/Graphs5/Again/Scam_0hrs.png")
# lots of text...

假设您谈论的是 PDF:

---
output: pdf_document
header-includes:
  - \usepackage{lscape}
---

# lots of text...

\begin{landscape}

```{r pressure, echo=FALSE, fig.cap="Fig. 1: Treatment durations...", out.width = '100%'}
plot(pressure)
```

\end{landscape}

# lots of text...

这是我所知道的唯一方法,而且它只适用于 PDF。