Вот как вы могли бы go сделать эти автоматизированные вкладки
---
title: "Untitled"
author: "me"
date: "14 April 2020"
output: html_document
---
```{r}
library(ggplot2)
library(ggforce)
```
## A header {.tabset}
```{r, results='asis'}
n <- 10
# Make main plot
plot <- ggplot(diamonds) +
geom_point(aes(carat, price), alpha = 0.1)
# Facet_*_paginate loop over facets
plots <- lapply(seq_len(n), function(i) {
plot + facet_wrap_paginate(~ cut:clarity, ncol = 1, nrow = 1, page = i)
})
# Print a tab and a plot for each n
# Important to set "results = 'asis'" in chunk options
for (i in seq_len(n)) {
cat(paste0("\n\n### Tab ", i, "\n"))
print(plots[[i]])
}
```