将bs_embed_popover函数插入到我的文件夹中

将bs_embed_popover函数插入到我的文件夹中,r,shiny,R,Shiny,朋友们,你们能帮我在我闪亮的眼睛里插上一个小布娃娃吗。我想添加一个类似下图的图标,以便能够生成描述性文本。 我想插入第一个单选按钮 library(shinyBS) library(shiny) ui <- fluidPage( titlePanel("Old Faithful Geyser Data"), sidebarLayout( sidebarPanel( radioButtons("fil

朋友们,你们能帮我在我闪亮的眼睛里插上一个小布娃娃吗。我想添加一个类似下图的图标,以便能够生成描述性文本。 我想插入第一个单选按钮

library(shinyBS)
library(shiny)

ui <- fluidPage(
  
  
  titlePanel("Old Faithful Geyser Data"),
  
  sidebarLayout(
    sidebarPanel(
      
      radioButtons("filter1", h3("Select properties"),
                     choices = list("All properties" = 1, 
                                    "Exclude properties" = 2),
                     selected = 1),
      
      radioButtons("filter2", h3("Select farms"),
                   choices = list("All farms" = 1, 
                                  "Exclude farms" = 2),
                   selected = 1),
      sliderInput("bins",
                  "Number of bins:",
                  min = 1,
                  max = 20,
                  value = 30)
    ),
    
    mainPanel(
      plotOutput("distPlot")
    )
  )
)

server <- function(input, output) {
  
  output$distPlot <- renderPlot({
     x    <- faithful[, 2]
    bins <- seq(min(x), max(x), length.out = input$bins + 1)
    
    hist(x, breaks = bins, col = 'darkgray', border = 'white')
  })
}

shinyApp(ui = ui, server = server)

库(shinyBS)
图书馆(闪亮)
用户界面

要获得单选按钮选项的弹出框,请执行以下操作:

  radioButtons(
    "filter1", 
    h3("Select properties"), 
    choiceValues = c(1, 2),
    choiceNames = list(
      tagList(
        tags$span("All properties"),
        tags$span(icon("info-circle"), id = "icon1", style = "color: blue;")
      ), 
      tagList(
        tags$span("Exclude properties"),
        tags$span(icon("info-circle"), id = "icon2", style = "color: blue;")
      )
    ),
    selected = 1
  ),

  bsPopover("icon1", "TITLE1", "CONTENT1", placement = "right"), 
  bsPopover("icon2", "TITLE2", "CONTENT2", placement = "right"), 

非常感谢你,斯泰芬。我可以为第一个单选按钮的每个选项创建这些图标吗?再次感谢非常感谢的朋友!请你看一下好吗。非常感谢。
  radioButtons(
    "filter1", 
    h3("Select properties"), 
    choiceValues = c(1, 2),
    choiceNames = list(
      tagList(
        tags$span("All properties"),
        tags$span(icon("info-circle"), id = "icon1", style = "color: blue;")
      ), 
      tagList(
        tags$span("Exclude properties"),
        tags$span(icon("info-circle"), id = "icon2", style = "color: blue;")
      )
    ),
    selected = 1
  ),

  bsPopover("icon1", "TITLE1", "CONTENT1", placement = "right"), 
  bsPopover("icon2", "TITLE2", "CONTENT2", placement = "right"),