【发布时间】:2021-12-02 10:39:48
【问题描述】:
我想为闪亮的应用创建目录体验。
所以也许是这样一个闪亮的应用程序:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sidebarMenu(
menuItem("plot", tabName = "plot"),
menuItem("slider", tabName = "slider")
)
),
dashboardBody(
tabItems(
# First tab content
tabItem(
tabName = "plot",
fluidRow(
box(plotOutput("plot1", height = 250)),
),
fluidRow(verbatimTextOutput('longtext')),
fluidRow(
box(
title = "slider",
sliderInput("slider", "Number of observations:", 1, 100, 50)
)
)
)
)
)
)
server <- function(input, output) {
output$plot1 <- renderPlot({hist(rnorm(500)[seq_len(input$slider)])})
output$longtext <- renderText({paste0(rep('blah', 100), collapse = '\n')})
}
shinyApp(ui, server)
但它的行为更像是在启用目录的情况下运行 R 降价。与下面的代码类似,单击目录中的部分会转到主应用程序中的相关部分。
---
title: "Untitled"
output:
html_document:
toc: true
toc_float: true
---
### section 1
`r paste0(rep('blah', 100), collapse = '<br/>')`
### section 2
section content
【问题讨论】:
标签: r shiny r-markdown