在Rmarkdown文档中调整嵌入Shiny应用程序的大小

6

我有一个托管在shinyapps.io上的闪亮应用程序。 我使用以下方法将其嵌入到html RMarkdown文档中:

 ```{r}
knitr::include_app("shiny app web address")
```

这个方法可以成功嵌入Shiny应用,但是我无法调整宽度。include_app()函数有调整高度的选项,但是我找不到调整imframe宽度的选项。
我尝试过以下方法:
```{r}
knitr::opts_chunk$set(fig.width=16, fig.height=8)
knitr::include_app("shiny app web address")
```

但是应用程序的宽度和高度没有调整。

有人有什么想法来调整嵌入式应用程序的宽度吗?

谢谢帮助。

编辑:我也尝试了这个:{r fig.width=16, fig.height=8},但没有成功。有什么想法吗?

1个回答

7
我会将它作为一个iframe插入到HTML中,如下所示:

---
title: "Untitled"
author: "Ian Wesley"
date: "February 28, 2018"
output: html_document
---

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


###App big

<iframe src ="https://gallery.shinyapps.io/087-crandash/" height=1000px width=1000px />

###App small

<iframe src ="https://gallery.shinyapps.io/087-crandash/" height=500px width=500px />

这导致的结果是:

在此输入图片描述


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接