使用柔性仪表板模板重现光泽 [英] reproducing shiny using flexdashboard template

查看:0
本文介绍了使用柔性仪表板模板重现光泽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我借用了下面这段代码,并对其进行了一些更改。基本上这使用fluidPage。我对使用flexdashboard重做相同的事情很感兴趣。我已经经历了flexdashboard userguide。 但该网站上的描述是以某种降价或缩水格式进行的吗?这是我不熟悉的。因此,如果我可以看到这个示例的Flexdashboard版本,而不是降价或缩水,那么我就可以很容易地与不同的组件关联并在此基础上进行构建。朋友们,我们非常感谢您的任何建议或建议。

library(shiny)
ui = shinyUI(fluidPage(
                mainPanel(
                 tabsetPanel(
                   tabPanel("Plot",plotOutput("plot1"),plotOutput("plot2")),
                   tabPanel("Summary",verbatimTextOutput("summary")),
                  tabPanel("Table",DT::dataTableOutput("table"))
                   ))))

server = shinyServer(function(input, output, session) {
  output$plot1 <- renderPlot({
    plot(cars)
  })

  output$plot2 <- renderPlot({
    plot(iris)
  })

  output$summary <- renderPrint({
    summary(cars)
  })

  output$table <- DT::renderDataTable({
    DT::datatable(cars)
  })
})

shinyApp(ui, server)

推荐答案

我很快就把它们组合在一起了。

不完美。但它通常能完成工作(我不得不离开工作,也许今晚晚些时候我会微调)

请注意,在此帖子之前,我也从未见过flexdashboard。我用过相当多的shinydashboard,还有RMarkdown,所以这绝对是很有趣的。除了shinydashboard,我不确定flexdashboard会为我个人增加什么,但我肯定会更多地使用它。

无论如何...

---
title: "Test App"
output: flexdashboard::flex_dashboard
---

Plot
=====================================  

row 
-------------------------------------


```{r}
library(shiny)
renderPlot({
  plot(cars)
})
```

row 
-------------------------------------

```{r}
renderPlot({
  plot(iris)
})
```   


Summary
=====================================     

```{r}   
renderPrint({
    summary(cars)
  })
```


Table
=====================================     

```{r}   
DT::renderDataTable({
    DT::datatable(cars)
  })
```

一个大问题是,当我调用ROW时,我得到的是单行上的两个绘图,而不是两个不同的行。我会打得更远。

这篇关于使用柔性仪表板模板重现光泽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆