小编jl1*_*121的帖子

Rshiny 布局框

无法为我遇到的这个特定问题找到正确的词语。

我希望盒子围绕汽车的图像,但考虑到图像的高度,这意味着它将下一个流体行移得更低。有没有办法让盒子看起来像我画红色盒子的地方?但更重要的是第 3 行汽车图像旁边的框(我不希望有人对第四个流体行进行编码!)。

我尝试合并垂直布局,但它只是使所有内容都垂直。

布局

代码:并使用任何图像替换下面

library(shinydashboard)
library(shiny)
library(shinyjs)

ui <- dashboardPage(
  dashboardHeader(disable = TRUE),
  dashboardSidebar(disable = TRUE),
  dashboardBody(
    useShinyjs(),
    dashboardBody(
      # the first row
      fluidRow(
        box( id = "box1",
             h4(strong(textOutput("box1"))),
             p(textOutput("box1_sub")),
             width = 2,
             solidHeader = TRUE
        ),
        box( id = "box2",
             h4(strong(textOutput("box2"))),
             p(textOutput("box2_sub")),
             width = 2,
             solidHeader = TRUE,
             background = "blue"
        ),
        box( id = "box3",
             h4(strong(textOutput("box3"))),
             p(textOutput("box3_sub")),
             width = 2,
             solidHeader = TRUE
        ),
        box( id = "box4",
             h4(strong(textOutput("box4"))),
             p(textOutput("box4_sub")),
             width = 2,
             solidHeader = TRUE, …
Run Code Online (Sandbox Code Playgroud)

r shiny

5
推荐指数
1
解决办法
456
查看次数

图像 for 单选按钮 r 闪亮

我正在学习如何使用图像作为单选按钮。

我找到了这个页面并一直在玩它: 你能有一个图像作为闪亮的单选按钮选择吗?

这里的答案非常有用,但应用程序不会加载单选按钮的 Rlogo(当使用函数使用答案的第二部分时)。我已将图像保存到 www 文件中。我尝试过用不同的方式编写该行,'<img src="Rlogo.png">' = 'logo'例如删除引号、将其替换为img(src='Rlogo.png') = 'logo'、将其替换为网络链接,但均不成功。请有人指出我哪里出错了,或者原始代码是否适合您!

徽标在这里:http://i1.wp.com/www.r-bloggers.com/wp-content/uploads/2016/02/Rlogo.png ?resize=300%2C263

代码是从页面复制过来的:

library(shiny)

radioButtons_withHTML <- function (inputId, label, choices, selected = NULL, inline = FALSE, 
          width = NULL) 
{
        choices <- shiny:::choicesWithNames(choices)
        selected <- if (is.null(selected)) 
                choices[[1]]
        else {
                shiny:::validateSelected(selected, choices, inputId)
        }
        if (length(selected) > 1) 
                stop("The 'selected' argument must be of length 1")
        options <- generateOptions_withHTML(inputId, choices, selected, inline, 
                                   type = "radio")
        divClass <- "form-group shiny-input-radiogroup shiny-input-container"
        if (inline) 
                divClass …
Run Code Online (Sandbox Code Playgroud)

html r shiny

2
推荐指数
1
解决办法
994
查看次数

标签 统计

r ×2

shiny ×2

html ×1