I'm having trouble getting fig.width and fig.height to work in R Markdown with flex_dashboard output, if I generate tabs using R code with results="asis".
In the following example, for the "A" page (with tabs entered manually), fig.width and fig.height work as I would expect. But on the "B" page (with the tabs generated using R code and results="asis"), fig.width and fig.height don't work as I would expect.
---
title: "Report"
output:
flexdashboard::flex_dashboard:
vertical_layout: scroll
---
```{r, include=FALSE}
library(ggplot2)
library(flexdashboard)
d <- data.frame(x = rep(c("g1", "g2"), each = 50),
y = rnorm(100))
```
# A
## A tabs {.tabset}
### g1
```{r, echo=FALSE, fig.width = 4, fig.height = 12}
qplot(y, data = d[d$x == "g1", ])
```
### g2
```{r, echo=FALSE, fig.width = 4, fig.height = 12}
qplot(y, data = d[d$x == "g2", ])
```
# B
## B tabs {.tabset}
```{r, echo=FALSE, fig.width = 4, fig.height = 12, results = "asis"}
for (g in c("g1", "g2")) {
cat(paste0("\n\n### ", g, "\n"))
print(qplot(y, data = d[d$x == g, ]))
}
```
The screenshot below is from the "A" page. Because of the fig.height=12, the image is tall and the window can be scrolled vertically, which is what I want.
The screenshot below is from the "B" page. Here the image is proportionally tall, but it doesn't occupy the full height of the browser window, which is not what I want.
I want to generate tabs using R code and results="asis" (as on the B page), but I want fig.height to make the image large (as on the A page). How can I do this?
I'm using rmarkdown version 2.14, flexdashboard version 0.5.2, and ggplot2 version3.3.6, in R version 4.2.1.
Thanks.

