r语言 - 将图片添加到 RShiny 操作按钮



如何将图像添加到 RShiny 操作按钮?就像一个 jpeg 文件...

shinyUI(fluidPage( 
  titlePanel("Image on button"),
  sidebarLayout(
    sidebarPanel(
    ),
    # Show a plot of the generated distribution
    mainPanel(
      actionButton("button","Submit"),
    )
  )
))

在我的解决方案下面

  shinyUI(fluidPage(
   titlePanel("Image on button"),
   sidebarLayout(
    sidebarPanel(
    ),
   #Show a plot of the generated distribution
    mainPanel(
      actionButton("button","Submit", ),
      tags$button(
        id = "my_button",
        class = "btn action_button",   
        tags$img(src = "http://i0.wp.com/unaracnidounacamiseta.com/wp-
        content/uploads/2012/07/lorem.jpg",height = "50px") #internet image
        #tags$img(src = "your_image.png",height = "50px") #local image
        ),     
       )
      )
     )
    )

最新更新