代码之家  ›  专栏  ›  技术社区  ›  tryingtosolve

在R中包含交互式文档

  •  1
  • tryingtosolve  · 技术社区  · 6 年前

    我知道如何在rmarkdown中通过以下步骤制作一个交互式文档 page . 然而,我想要的是不同的。我想创建一个交互式文档,例如下面的示例:

    ---
    title: "Shiny Document"
    output: html_document
    runtime: shiny
    ---
    
    ```{r, echo=FALSE}
    sliderInput("bins", "Number of bins:", 30, min = 1, max = 50)
    
    renderPlot({
      x    = faithful[, 2]  # Old Faithful Geyser data
      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')
    })
    ```
    

    我想在我闪亮的应用程序中加入这个。我知道我可以直接在 ui 在闪亮中发挥作用。但是,我希望有一个单独的文件来存储页面的信息,而不是包含页面中的所有内容 用户界面

    0 回复  |  直到 6 年前