【问题标题】:Multiple Shiny apps in ioslide presentationsioslide 演示文稿中的多个闪亮应用程序
【发布时间】:2019-01-18 20:40:41
【问题描述】:

我正在尝试使用 Shiny 应用程序和 ioslides 开发我的课堂演讲幻灯片。我想要几个闪亮的应用程序,每个应用程序都在不同的幻灯片上来说明不同的概念。当我天真地在幻灯片上为应用程序编写输入和渲染代码时,只有第一个应用程序可以工作,而后面的应用程序不能工作。

我是否必须在启动第二个应用程序之前关闭第一个应用程序(等等)?我似乎无法在任何地方找到答案,我希望这里有人可以引导我走向正确的方向。提前谢谢。

【问题讨论】:

  • 没关系。我似乎已经弄清楚出了什么问题。
  • 您应该指出哪里出了问题,以帮助将来遇到类似问题的其他人。
  • 我试图在两张相邻的幻灯片上写两个闪亮的应用程序。当我翻阅幻灯片时,应用程序 1 始终有效,而当我翻到第二张幻灯片时,应用程序 2 始终无法工作。如果我反向翻阅幻灯片,应用程序 1 工作。问题是我用于 Shiny 应用程序的模板。现在两者都可以工作。

标签: shiny r-markdown ioslides


【解决方案1】:

我最近遇到了同样的问题,你必须避免它认为你在同一个演示文稿中制作了不同的闪亮应用程序,因为漏洞文档是一个闪亮的运行时。在这里,您不必显式创建对象“ui”和“serve”

看看这个例子,看看你能不能明白

    ---
    title: "Shiny app - stackoverflow help"
    author: "Johan Rosa"
    date: "August 8, 2018"
    output: ioslides_presentation
    runtime: shiny
    ---   
     ## first slide
                    
        ```{r}
        fluidPage(
           
           # Application title
           titlePanel("Old Faithful Geyser Data"),
           
           # Sidebar with a slider input for number of bins 
           sidebarLayout(
              sidebarPanel(
                 sliderInput("bins",
                             "Number of bins:",
                             min = 1,
                             max = 50,
                             value = 30)
              ),
              
              # Show a plot of the generated distribution
              mainPanel(
                 plotOutput("distPlot")
              )
           )
        )
        ```


    
        ```{r}
        output$distPlot <- renderPlot({
              # generate bins based on input$bins from ui.R
              x    <- faithful[, 2] 
              bins <- seq(min(x), max(x), length.out = input$bins + 1)
              
              # draw the histogram with the specified number of bins
              hist(x, breaks = bins, col = 'darkgray', border = 'white')
           })
        ```

## next slide

#The other app you want toy show, just the way i did it in the first slide

【讨论】:

  • 感谢您的帮助。这正是我修复幻灯片的方式(见上文,8/11)。
猜你喜欢
  • 2014-10-28
  • 2014-07-30
  • 2014-08-25
  • 2017-03-10
  • 2017-11-11
  • 1970-01-01
  • 2016-07-17
  • 1970-01-01
  • 2016-03-12
相关资源
最近更新 更多