使用R中的图标创建下拉菜单并更新绘图

时间:2017-09-14 10:19:24

标签: r shiny shinydashboard shinyapps

给定的绘图创建如下的快照。但是,点击Circle图标后,我只看到下拉列表中的第一个元素,我想要显示所有下拉元素,即“A”,“B”,“C”,“D”,“E”,“F ”。我得到的警告在脚本下面提到:

## app.R ##
library(shiny)
library(shinydashboard)
library(shinyWidgets)

ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
),
dashboardBody(

dropdownButton(
  pickerInput(inputId = "uppickerIcons", 
              label = "", 
              choices = c("A", 
                          "B", 
                          "C", 
                          "D", 
                          "E", 
                          "F"), 
              choicesOpt = list(icon = c("glyphicon glyphicon-arrow-right", 
                                         "glyphicon glyphicon-cog", 
                                         "glyphicon glyphicon-play", 
                                         "glyphicon glyphicon-ok-sign", 
                                         "glyphicon glyphicon-euro", 
                                         "glyphicon glyphicon-music")), 
              options = list(`icon-base` = "")),
  circle = TRUE, status = "danger", icon = icon("gear"), width = "300px",
  tooltip = tooltipOptions(title = "Click to see inputs !")
 )
 )
 )
 server <- function(input, output) 
 {
 }
 shinyApp(ui, server)

警告讯息:

Warning in if (!is.na(attribValue)) { :
the condition has length > 1 and only the first element will be used
Warning in charToRaw(enc2utf8(text)) :
argument should be a character vector of length 1
all but the first element will be ignored

enter image description here

0 个答案:

没有答案