R Shiny 将图片添加到带有文本的流体行中的框中

标签 r image shiny

<分区>

我正在尝试添加一个框作为 Shiny 应用程序的一部分,以在应用程序顶部包含一些文本(说明)和图像( Logo )。这是我到目前为止的代码。

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


  )

)

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

目前我已经指定了一个 textOuput 参数,但我需要将图像作为同一个框的一部分包含在内,并右对齐。有什么建议吗?

最佳答案

如何在框内添加一个 fluidRow,它有 2 列,一列用于文本,另一列用于图像?

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

关于R Shiny 将图片添加到带有文本的流体行中的框中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44279773/

相关文章:

python - 使用rpy2,如何调用变量名中包含 "."的函数?

regex - 如何使用 R 解析 html 字符串?

python - 处理图像作为mnist模型的输入

html - 无限滚动使图像重复Y

r - Shiny 使用条件面板中选择元素的数量

r - 为r中数据框中的每一行选择最低5个值的colnames

r - 如何在 R 中安装软件包 keras

ios - 快速 iOS : Get image from gallery by created date

javascript - shinyBS 观察 bsCollapsePanel 的切换

r - Shiny 的 "ERROR: Tabs should all be unnamed arguments"