我在光泽和我的选择下拉菜单中使用selectInput我想有些话之间的多个空格。然而,只包含空格将不会显示,在应用程序中最多只有一个空格。闪亮的额外空白
例如在代码示例下面我有“缸”和“我”之间的多个空格,但是如果你运行这个只有一个会显示 - 怎样才能解决这个问题?
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)
}
我发现了一些使用'pre()'的空白帮助链接,但是因为在'selectInput'函数调用中需要额外的空格,所以它会更难。该函数接受值并在内部创建html代码。如果不深入源代码,我看不到一种方法。希望别人能有更多的运气。 –
有没有办法覆盖selectInput之外的标签? – user7066213
这将是一个艰难的文本解析工作。这是可能的,但不切实际。 –