Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Shiny add picture to box in fluid row with text [duplicate]

Tags:

r

image

shiny

I am trying to add a box as part of a Shiny application to contain some text (instructions) and an image (logo) at the top of the application. This is the code I have so far.

frow5 <- fluidRow(
  box(
    title = "Instructions"
    ,status = "primary"
    ,solidHeader = FALSE 
    ,collapsible = FALSE 
    ,textOutput("instructions")
    , height = 320
    , width = 12
    , align='ccc'


  )

)

output$instructions <- renderText("Some text")

At the moment I have specified a textOuput parameter, but I need an image to be included as part of the same box, aligned right. any suggestions?

like image 471
OwlieW Avatar asked Sep 05 '25 22:09

OwlieW


1 Answers

How about adding a fluidRow inside the box, having 2 columns, one for text and the other for the image?

box(title = "Instructions",
    status = "primary",
    solidHeader = F,
    collapsible = F,
    width = 12,
    fluidRow(column(width = 10, textOutput( "instructions" )),
             column(width = 2, align = "center",
                      img(src="http://images.all-free-download.com/images/graphiclarge/natural_beauty_highdefinition_picture_166133.jpg", width=100))))

enter image description here

like image 129
shosaco Avatar answered Sep 10 '25 10:09

shosaco