【问题标题】:Adjust the size of an embedded Shiny App within Rmarkdown document在 Rmarkdown 文档中调整嵌入 Shiny App 的大小
【发布时间】:2018-05-25 15:14:57
【问题描述】:

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

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

这行得通,我成功地看到了嵌入的闪亮应用程序,但我无法调整宽度。 include_app() 有一个调整高度的选项,但我找不到调整框架宽度的选项。

我试过这个:

```{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}没有运气。有什么想法吗?

【问题讨论】:

    标签: r shiny knitr r-markdown


    【解决方案1】:

    我只是将它作为 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 />
    

    结果:

    【讨论】:

      猜你喜欢
      • 2021-11-04
      • 1970-01-01
      • 2015-01-09
      • 2021-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-08
      • 2021-11-25
      相关资源
      最近更新 更多