我正在使用闪亮的 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) 如果在带有消息或通知项的标题中包含下拉列表,则会在单击时自动显示"您有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)