我从 Shinygallery 借用了下面的代码并进行了一些更改。基本上这使用fluidPage
. 我有兴趣使用flexdashboard
. 我已经阅读了flexdashboard 用户指南。但是该网站上的描述是某种 rmarkdown 或 sweave 格式?我不熟悉。因此,如果我可以在没有降价或 sweave 的情况下看到此示例的 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)