2017-05-26 28 views
1

如何将图像添加到RShiny动作按钮?就像一个JPEG文件...将图片添加到RShiny动作按钮

shinyUI(fluidPage( 
    titlePanel("Image on button"), 

    sidebarLayout(
    sidebarPanel(

    ), 

    # Show a plot of the generated distribution 
    mainPanel(
     actionButton("button","Submit"), 
    ) 
) 
)) 
+0

不要ü需要一个图片或字体真棒会做什么? http://fontawesome.io/icons/,如果是这样的话'actionButton'和其他许多编辑都有'icon'参数 –

回答

0

下面我的解决办法

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 ),
) ) ) )