小编use*_*213的帖子

selectInput 选择显示标签中闪亮的额外空白

我正在使用闪亮的 selectInput ,并且在我的选择的下拉菜单中我想要在一些单词之间有多个空格。但只包含空格是不会显示的,应用程序中最多有一个空格。

例如,在下面的代码示例中,“Cylinder”和“I”之间有多个空格,但是如果运行此命令,只会显示一个空格 - 我该如何解决这个问题?

ui <- fluidPage(
  selectInput("variable", "Variable:",
              c("Cylinder          I want multiple spaces here" = "cyl",
                "Transmission" = "am",
                "Gears" = "gear")),
  tableOutput("data")
)

server <- function(input, output) {
  output$data <- renderTable({
    mtcars[, c("mpg", input$variable), drop = FALSE]
  }, rownames = TRUE)
}

shinyApp(ui, server)
}
Run Code Online (Sandbox Code Playgroud)

html r shiny

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

闪亮的仪表板标题修改下拉列表

如果在带有消息或通知项的标题中包含下拉列表,则会在单击时自动显示"您有1条消息"这一句子.我怎样才能显示消息而不是"你有1条消息"这句话?

示例重现如下:

    ui <- dashboardPage(
  dashboardHeader(dropdownMenu(type = "messages",
                               messageItem(
                                 from = "Sales Dept",
                                 message = "Sales are steady this month."
                               ))),
  dashboardSidebar(),
  dashboardBody()
)

server <- function(input, output) { }

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

r shiny shinydashboard

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

标签 统计

r ×2

shiny ×2

html ×1

shinydashboard ×1