我希望能够创建多个页面,每个页面都有一组小部件下拉,单选按钮和绘制地图的空间.Shiny教程展示了如何创建多个页面
shinyUI(navbarPage("My Application",
tabPanel("Component 1"),
tabPanel("Component 2"),
tabPanel("Component 3")
))
Run Code Online (Sandbox Code Playgroud)
如何在每个页面中添加小部件,例如如何将以下内容添加到组件1?
sidebarLayout(
sidebarPanel(
selectizeInput(
'id', label = "Year", choices = NULL,multiple=FALSE,selected="X2015",
options = list(create = TRUE,placeholder = 'Choose the year')
),
# Make a list of checkboxes
radioButtons("radio", label = h3("Radio buttons"),
choices = list("Choice 1" = 1,
"Choice 2" = 2)
Run Code Online (Sandbox Code Playgroud)
和
mainPanel(
plotOutput("distPlot")
)
Run Code Online (Sandbox Code Playgroud)
您应该阅读以下参考页面tabPanel
:http://shiny.rstudio.com/reference/shiny/latest/tabPanel.html
shinyUI(
navbarPage("My Application",
tabPanel(
"Component 1",
sidebarLayout(
sidebarPanel(
selectizeInput(
'id', label="Year", choices=NULL, multiple=F, selected="X2015",
options = list(create = TRUE,placeholder = 'Choose the year')
),
# Make a list of checkboxes
radioButtons("radio", label = h3("Radio buttons"),
choices = list("Choice 1" = 1, "Choice 2" = 2)
)
),
mainPanel( plotOutput("distPlot") )
)
),
tabPanel("Component 2"),
tabPanel("Component 3")
)
)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11140 次 |
最近记录: |